@just-every/mcp-read-website-fast 0.1.7 → 0.1.8
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/dist/parser/dom.js +4 -4
- package/package.json +1 -1
package/dist/parser/dom.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSDOM } from 'jsdom';
|
|
1
|
+
import { JSDOM, VirtualConsole } from 'jsdom';
|
|
2
2
|
export function htmlToDom(html, url) {
|
|
3
3
|
try {
|
|
4
4
|
return new JSDOM(html, {
|
|
@@ -8,7 +8,7 @@ export function htmlToDom(html, url) {
|
|
|
8
8
|
runScripts: undefined,
|
|
9
9
|
resources: undefined,
|
|
10
10
|
pretendToBeVisual: true,
|
|
11
|
-
virtualConsole: new
|
|
11
|
+
virtualConsole: new VirtualConsole().sendTo(console, { omitJSDOMErrors: true }),
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
catch {
|
|
@@ -16,14 +16,14 @@ export function htmlToDom(html, url) {
|
|
|
16
16
|
return new JSDOM(html, {
|
|
17
17
|
url,
|
|
18
18
|
contentType: 'text/html',
|
|
19
|
-
virtualConsole: new
|
|
19
|
+
virtualConsole: new VirtualConsole().sendTo(console, { omitJSDOMErrors: true }),
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
catch {
|
|
23
23
|
return new JSDOM(`<!DOCTYPE html><html><body>${html}</body></html>`, {
|
|
24
24
|
url,
|
|
25
25
|
contentType: 'text/html',
|
|
26
|
-
virtualConsole: new
|
|
26
|
+
virtualConsole: new VirtualConsole().sendTo(console, { omitJSDOMErrors: true }),
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
}
|
package/package.json
CHANGED