diff options
Diffstat (limited to 'js/src/util/sanitizer.js')
| -rw-r--r-- | js/src/util/sanitizer.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/js/src/util/sanitizer.js b/js/src/util/sanitizer.js index 11b28a9d9..9df43142a 100644 --- a/js/src/util/sanitizer.js +++ b/js/src/util/sanitizer.js @@ -5,6 +5,8 @@ * -------------------------------------------------------------------------- */ +import { getWindow } from './index' + const uriAttributes = new Set([ 'background', 'cite', @@ -98,7 +100,8 @@ export function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) { return sanitizeFn(unsafeHtml) } - const domParser = new window.DOMParser() + const windowRef = getWindow() + const domParser = new windowRef.DOMParser() const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html') const elements = [].concat(...createdDocument.body.querySelectorAll('*')) |
