deno-dom: Doesn't work with moz-readability

import Readability from "https://cdn.esm.sh/v57/moz-readability@0.2.1/es2021/moz-readability.js"
import { DOMParser } from "https://deno.land/x/deno_dom/deno-dom-wasm.ts";


    const doc = new DOMParser().parseFromString(body, "text/html");
    const article = new Readability(doc).parse();
    console.log(article);

/// [uncaught application error]: TypeError - Cannot read properties of undefined (reading 'nextElementSibling')

Readbility needs a window.document object. Does deno_dom provide that?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 28 (11 by maintainers)

Most upvoted comments

Go ahead