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

Function parse

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

Source from the content-addressed store, hash-verified

2464 'IN_PLACE: literal-text element from an XHTML document loses markup text like in HTML mode',
2465 (assert) => {
2466 const parse = (body) =>
2467 new window.DOMParser().parseFromString(
2468 '<div xmlns="http://www.w3.org/1999/xhtml">' + body + '</div>',
2469 'application/xhtml+xml'
2470 ).documentElement;
2471
2472 const noembedRoot = parse(
2473 '<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