mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
fix: use DOMParser from globalThis
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import { decodeHTML5 } from "entities";
|
||||
import { DOMParser } from "linkedom/worker";
|
||||
|
||||
const RealDOMParser =
|
||||
"window" in global && "DOMParser" in window
|
||||
? new window.DOMParser()
|
||||
: new DOMParser();
|
||||
|
||||
export const parseHTML = (input) =>
|
||||
RealDOMParser.parseFromString(wrapIntoHTMLDocument(input), "text/html");
|
||||
new globalThis.DOMParser().parseFromString(
|
||||
wrapIntoHTMLDocument(input),
|
||||
"text/html"
|
||||
);
|
||||
|
||||
export function getDummyDocument() {
|
||||
const doc = parseHTML("<div></div>");
|
||||
|
||||
Reference in New Issue
Block a user