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

Function parse

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

Source from the content-addressed store, hash-verified

1688 'IN_PLACE: literal-text element from an XHTML document loses markup text like in HTML mode',
1689 (assert) => {
1690 const parse = (body) =>
1691 new window.DOMParser().parseFromString(
1692 '<div xmlns="http://www.w3.org/1999/xhtml">' + body + '</div>',
1693 'application/xhtml+xml'
1694 ).documentElement;
1695
1696 const noembedRoot = parse(
1697 '<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