Skip to content

Commit dca3734

Browse files
authored
Refactor jsdom import in extractMainHtml function for compatibility (#69)
1 parent 7158229 commit dca3734

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/converters.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ function cleanUrl(urlString: string): string {
3939
*/
4040
function extractMainHtml(html: string): string {
4141
try {
42-
const { JSDOM } = require("jsdom");
42+
const jsdomModule = require("jsdom");
43+
const { JSDOM } = jsdomModule.default || jsdomModule;
4344
const dom = new JSDOM(html);
4445
const doc = dom.window.document;
4546

0 commit comments

Comments
 (0)