extract-webpage 1.2.55 → 1.2.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "extract-webpage",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.57",
|
|
4
4
|
"module": "./dist/extract-webpage.es.js",
|
|
5
5
|
"description": "Search, extract, cite, and outline the web for a topic with AI Research Agent.",
|
|
6
6
|
"author": "vtempest <grokthiscontact@gmail.com>",
|
|
@@ -72,19 +72,20 @@
|
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"@huggingface/transformers": "^3.8.1",
|
|
74
74
|
"ai": "^5.0.0",
|
|
75
|
-
"chat-agent-toolkit": "^1.2.
|
|
75
|
+
"chat-agent-toolkit": "^1.2.56",
|
|
76
76
|
"chrono-node": "^2.9.0",
|
|
77
77
|
"drizzle-orm": "^0.45.1",
|
|
78
|
-
"extract-pdf": "^0.1.
|
|
79
|
-
"extract-youtube": "^1.0.
|
|
80
|
-
"prismjs": "^1.30.0",
|
|
78
|
+
"extract-pdf": "^0.1.44",
|
|
79
|
+
"extract-youtube": "^1.0.44",
|
|
81
80
|
"html-entities": "^2.6.0",
|
|
82
81
|
"js-yaml": "^4.1.1",
|
|
83
82
|
"jsdom": "^28.1.0",
|
|
84
83
|
"jszip": "^3.10.1",
|
|
85
84
|
"linkedom": "^0.18.12",
|
|
86
85
|
"marked": "^17.0.4",
|
|
86
|
+
"marked-highlight": "^2.2.4",
|
|
87
87
|
"node-fetch": "^3.3.2",
|
|
88
|
+
"prismjs": "^1.30.0",
|
|
88
89
|
"qwksearch-api-client": "^0.0.12",
|
|
89
90
|
"zod": "^4.3.6"
|
|
90
91
|
},
|
|
@@ -158,6 +158,12 @@ import "prismjs/components/prism-java";
|
|
|
158
158
|
import "prismjs/components/prism-c";
|
|
159
159
|
import "prismjs/components/prism-cpp";
|
|
160
160
|
|
|
161
|
+
function highlightCode(code, lang) {
|
|
162
|
+
const language = Prism.languages[lang] ? lang : "plaintext";
|
|
163
|
+
if (language === "plaintext") return code;
|
|
164
|
+
return Prism.highlight(code, Prism.languages[language], language);
|
|
165
|
+
}
|
|
166
|
+
|
|
161
167
|
/**
|
|
162
168
|
* Converts Markdown text to HTML. It handles the following Markdown elements:
|
|
163
169
|
* - Headers (h1 to h6)
|
|
@@ -189,9 +195,7 @@ export function convertMarkdownToHTML(content, toHtml = true) {
|
|
|
189
195
|
|
|
190
196
|
marked.setOptions({
|
|
191
197
|
highlight: function (code, lang) {
|
|
192
|
-
|
|
193
|
-
if (language === "plaintext") return code;
|
|
194
|
-
return Prism.highlight(code, Prism.languages[language], language);
|
|
198
|
+
return highlightCode(code, lang) ?? code;
|
|
195
199
|
},
|
|
196
200
|
langPrefix: "language-",
|
|
197
201
|
});
|