[ { "config": null, "input": [], "inputType": "literal", "output": null, "exceptionType": "TypeError", "negativeTest": false, "message": "Sanitizer.sanitize() should throw an error." }, { "config": null, "input": [ null ], "inputType": "literal", "output": null, "exceptionType": "TypeError", "negativeTest": false, "message": "Sanitizer.sanitize(null)." }, { "config": null, "input": [ "hello" ], "inputType": "document-fragment", "output": "hello", "negativeTest": false, "message": "Sanitizer.sanitze(DocumentFragment)" }, { "config": null, "input": [ "hello" ], "inputType": "document", "output": "hello", "negativeTest": false, "message": "Sanitizer.sanitze(Document)" }, { "config": {}, "input": [ "
test" ], "inputType": "document", "output": "test", "negativeTest": false, "message": "SanitizerAPI with config: string, sanitize from document function for " }, { "config": {}, "input": [ "bla" ], "inputType": "document", "output": "bla", "negativeTest": false, "message": "SanitizerAPI with config: html fragment, sanitize from document function for " }, { "config": {}, "input": [ "" }, { "config": {}, "input": [ "[object Object]" ], "inputType": "document", "output": "[object Object]", "negativeTest": false, "message": "SanitizerAPI with config: empty object, sanitize from document function for " }, { "config": {}, "input": [ "1" ], "inputType": "document", "output": "1", "negativeTest": false, "message": "SanitizerAPI with config: number, sanitize from document function for " }, { "config": {}, "input": [ "0" ], "inputType": "document", "output": "0", "negativeTest": false, "message": "SanitizerAPI with config: zeros, sanitize from document function for " }, { "config": {}, "input": [ "3" ], "inputType": "document", "output": "3", "negativeTest": false, "message": "SanitizerAPI with config: arithmetic, sanitize from document function for " }, { "config": {}, "input": [ "" ], "inputType": "document", "output": "", "negativeTest": false, "message": "SanitizerAPI with config: empty string, sanitize from document function for " }, { "config": {}, "input": [ "undefined" ], "inputType": "document", "output": "undefined", "negativeTest": false, "message": "SanitizerAPI with config: undefined, sanitize from document function for " }, { "config": {}, "input": [ "test" ], "inputType": "document", "output": "test", "negativeTest": false, "message": "SanitizerAPI with config: document, sanitize from document function for " }, { "config": {}, "input": [ "Click.
" ], "inputType": "document", "output": "Click.
", "negativeTest": false, "message": "SanitizerAPI with config: onclick scripts, sanitize from document function for " }, { "config": {}, "input": [ "text
" ], "inputType": "document", "output": "<p>text</p>", "negativeTest": false, "message": "SanitizerAPI with config: plaintext, sanitize from document function for " }, { "config": {}, "input": [ "bla" ], "inputType": "document", "output": "
bla
", "negativeTest": false, "message": "SanitizerAPI with config: test html without close tag with dropElements list ['div'], sanitize from document function for " }, { "config": {}, "input": [ "t
div
div
", "negativeTest": false, "message": "SanitizerAPI with config: allowElements list [\"p\"], sanitize from document function for " }, { "config": { "dropElements": [ "div" ], "allowElements": [ "div" ] }, "input": [ "bla" ], "inputType": "document", "output": "bla", "negativeTest": false, "message": "SanitizerAPI with config: allowElements list has no influence to dropElements, sanitize from document function for
" }, { "config": { "dropAttributes": [ { "name": "style", "elements": [ "p" ] } ] }, "input": [ "Click.
Click.
Click.
" ], "inputType": "document", "output": "Click.
", "negativeTest": false, "message": "SanitizerAPI with config: empty dropAttributes list with id attribute, sanitize from document function for " }, { "config": { "dropAttributes": [ { "name": "id", "elements": "*" } ] }, "input": [ "Click.
" ], "inputType": "document", "output": "Click.
", "negativeTest": false, "message": "SanitizerAPI with config: dropAttributes list {\"id\": [\"*\"]} with id attribute, sanitize from document function for " }, { "config": { "dropAttributes": [ { "name": "data-attribute-with-dashes", "elements": "*" } ] }, "input": [ "Click.
" ], "inputType": "document", "output": "Click.
", "negativeTest": false, "message": "SanitizerAPI with config: dropAttributes list {\"data-attribute-with-dashes\": [\"*\"]} with dom dataset js access, sanitize from document function for " }, { "config": { "allowAttributes": [ { "name": "id", "elements": [ "div" ] } ] }, "input": [ "P
P
Click.
" ], "inputType": "document", "output": "Click.
", "negativeTest": false, "message": "SanitizerAPI with config: allowAttributes list {\"id\": [\"*\"]} with id attribute and onclick scripts, sanitize from document function for " }, { "config": { "dropAttributes": [ { "name": "style", "elements": "*" } ], "allowAttributes": [ { "name": "style", "elements": "*" } ] }, "input": [ "Click.
" ], "inputType": "document", "output": "Click.
", "negativeTest": false, "message": "SanitizerAPI with config: allowAttributes list has no influence to dropAttributes, sanitize from document function for " }, { "config": { "allowElements": [ "template", "div" ] }, "input": [ "Some text
Some more text
" ], "inputType": "document", "output": "Some text
Some more text
", "negativeTest": false, "message": "SanitizerAPI with config: malformed HTML, sanitize from document function for " }, { "config": {}, "input": [ "Some text
Some more text
" ], "inputType": "document", "output": "Some text
Some more text
", "negativeTest": false, "message": "SanitizerAPI with config: HTML with comments; comments not allowed, sanitize from document function for " }, { "config": { "allowComments": true }, "input": [ "Some text
Some more text
" ], "inputType": "document", "output": "Some text
Some more text
", "negativeTest": false, "message": "SanitizerAPI with config: HTML with comments; allowComments, sanitize from document function for " }, { "config": { "allowComments": false }, "input": [ "Some text
Some more text
" ], "inputType": "document", "output": "Some text
Some more text
", "negativeTest": false, "message": "SanitizerAPI with config: HTML with comments; !allowComments, sanitize from document function for " }, { "config": {}, "input": [ "commentintext
" ], "inputType": "document", "output": "commentintext
", "negativeTest": false, "message": "SanitizerAPI with config: HTML with comments deeper in the tree, sanitize from document function for " }, { "config": { "allowComments": true }, "input": [ "commentintext
" ], "inputType": "document", "output": "commentintext
", "negativeTest": false, "message": "SanitizerAPI with config: HTML with comments deeper in the tree, allowComments, sanitize from document function for " }, { "config": { "allowComments": false }, "input": [ "commentintext
" ], "inputType": "document", "output": "commentintext
", "negativeTest": false, "message": "SanitizerAPI with config: HTML with comments deeper in the tree, !allowComments, sanitize from document function for " }, { "config": { "allowElements": [ "svg" ] }, "input": [ "" ], "inputType": "document", "output": "", "negativeTest": false, "message": "SanitizerAPI with config: Unknown HTML names (HTMLUnknownElement instances) should not match elements parsed as non-HTML namespaces., sanitize from document function for " }, { "config": { "allowElements": [ "div", "svg" ] }, "input": [ "" ], "inputType": "document", "output": "", "negativeTest": false, "message": "SanitizerAPI with config: Unknown HTML names (HTMLUnknownElement instances) should not match elements parsed as non-HTML namespaces when nested., sanitize from document function for " }, { "config": { "dropElements": [ "I", "DL" ] }, "input": [ "Click.
" ], "inputType": "document", "output": "Click.
", "negativeTest": false, "message": "SanitizerAPI with config: dropAttributes list {\"ID\": [\"*\"]} with id attribute, sanitize from document function for " }, { "config": { "dropAttributes": [ { "name": "ID", "elements": "*" } ] }, "input": [ "Click.
" ], "inputType": "document", "output": "Click.
", "negativeTest": false, "message": "SanitizerAPI with config: dropAttributes list {\"ID\": [\"*\"]} with ID attribute, sanitize from document function for " }, { "config": { "dropAttributes": [ { "name": "id", "elements": "*" } ] }, "input": [ "Click.
" ], "inputType": "document", "output": "Click.
", "negativeTest": false, "message": "SanitizerAPI with config: dropAttributes list {\"id\": [\"*\"]} with ID attribute, sanitize from document function for " }, { "config": { "dropElements": [ 123, "test", "i", "custom-element" ] }, "input": [ "div
div
", "negativeTest": false, "message": "SanitizerAPI with config: allowElements with unknown elements and without allowUnknownMarkup, sanitize from document function for " }, { "config": { "dropElements": [ 123, "test", "i", "custom-element" ], "allowUnknownMarkup": true }, "input": [ "div
div
Click.
", "inputType": "template-content", "output": "Click.
", "negativeTest": false, "message": "SanitizerAPI with config: onclick scripts, sanitize from document fragment function for " }, { "config": {}, "input": "text
", "inputType": "template-content", "output": "<p>text</p>", "negativeTest": false, "message": "SanitizerAPI with config: plaintext, sanitize from document fragment function for " }, { "config": {}, "input": "bla", "inputType": "template-content", "output": "
bla
", "negativeTest": false, "message": "SanitizerAPI with config: test html without close tag with dropElements list ['div'], sanitize from document fragment function for " }, { "config": {}, "input": "t
div
div
", "negativeTest": false, "message": "SanitizerAPI with config: allowElements list [\"p\"], sanitize from document fragment function for " }, { "config": { "dropElements": [ "div" ], "allowElements": [ "div" ] }, "input": "bla",
"inputType": "template-content",
"output": "bla",
"negativeTest": false,
"message": "SanitizerAPI with config: allowElements list has no influence to dropElements, sanitize from document fragment function for "
},
{
"config": {
"dropAttributes": [
{
"name": "style",
"elements": [
"p"
]
}
]
},
"input": " Click. Click. Click. Click. Click. Click. Click. Click. P P Click. Click. Click. Click. Some text Some more text Some text Some more text Some text Some more text Some text Some more text Some text Some more text Some text Some more text Some text Some more text Some text Some more text commentintext commentintext commentintext commentintext commentintext commentintext Click. Click. Click. Click. Click. Click. div div div div Hello Hellotest
test
test
test