@aegisjsproject/sanitizer
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -9,2 +9,7 @@ # Changelog | ||
## [v0.0.4] - 2024-03-27 | ||
### Fixed | ||
- Use `aegis-sanitizer#html` policy on content given to `parser.parseFromString()` | ||
## [v0.0.3] - 2024-03-27 | ||
@@ -11,0 +16,0 @@ |
{ | ||
"name": "@aegisjsproject/sanitizer", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "A polyfill for the Sanitizer API with various sanitizer configs", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -40,3 +40,3 @@ import { sanitizer as sanitizerConfig } from './config/html.js'; | ||
export function parseHTML(content, { sanitizer = sanitizerConfig } = {}) { | ||
const doc = new DOMParser().parseFromString(content, 'text/html'); | ||
const doc = new DOMParser().parseFromString(policy.createHTML(content), 'text/html'); | ||
sanitize(doc, sanitizer); | ||
@@ -43,0 +43,0 @@ return doc; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
83860