MCPcopy Create free account
hub / github.com/cure53/DOMPurify / parse

Function parse

test/test-suite.js:2534–2538  ·  view source on GitHub ↗
(body)

Source from the content-addressed store, hash-verified

2532 'IN_PLACE: literal-text element from an XHTML document loses markup text like in HTML mode',
2533 (assert) => {
2534 const parse = (body) =>
2535 new window.DOMParser().parseFromString(
2536 '<div xmlns="http://www.w3.org/1999/xhtml">' + body + '</div>',
2537 'application/xhtml+xml'
2538 ).documentElement;
2539
2540 const noembedRoot = parse(
2541 '<noembed>&lt;/style&gt;&lt;img src="x" onerror="alert(1)"/&gt;</noembed>'

Callers 1

test-suite.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected