LiveDOM NG
Enter HTML markup below and compare how it is parsed by various parsers and sanitizers.
DOMParser
#document
<
html html
>
<
html head
/>
<
html body
/>
Settings
Share URL (
copy
)
Show namespaces
Ignore empty text nodes
Parser:
DOMParser
template.innerHTML
iframe (with scripts vs without scripts)
DOMPurify
Closure Sanitizer
Sanitizer API
XML Parser
// name: DOMParser
class
LiveDomParser
{
init() {
this
.parser =
new
DOMParser
();
}
/** @param {string} s */
parse(s) {
display(
this
.parser.parseFromString(s,
"text/html"
),
"DOMParser"
);
}
}
Enter to Rename, Shift+Enter to Preview
Update parser
Save as custom parser