UNPKG

@zougui/common.furaffinity

Version:

16 lines 645 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parseSafeHTML = void 0; const string_strip_html_1 = require("string-strip-html"); const jsdom_1 = require("jsdom"); const parseSafeHTML = (html) => { const safeHtml = (0, string_strip_html_1.stripHtml)(html, { onlyStripTags: ['script', 'style', 'xml'], stripTogetherWithTheirContents: ['script', 'style', 'xml'], }); const { window } = new jsdom_1.JSDOM(`<!DOCTYPE html>${safeHtml.result}`); const { document } = window; return { window, document }; }; exports.parseSafeHTML = parseSafeHTML; //# sourceMappingURL=html.js.map