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

Function reparsedText

test/test-suite.js:1195–1199  ·  view source on GitHub ↗
(html)

Source from the content-addressed store, hash-verified

1193 // A reparse drops the inner <form> tag and joins the text around it
1194 const dirty = '<form><div>{</form><form>{x}</form>}';
1195 const reparsedText = (html) => {
1196 const div = document.createElement('div');
1197 div.innerHTML = html;
1198 return div.textContent;
1199 };
1200
1201 const clean = DOMPurify.sanitize(dirty, { SAFE_FOR_TEMPLATES: true });
1202 assert.notOk(/{{|}}/.test(reparsedText(clean)));

Callers 1

test-suite.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected