We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8dbd3d commit 626a4f4Copy full SHA for 626a4f4
src/trix/models/html_sanitizer.js
@@ -8,7 +8,9 @@ const DEFAULT_FORBIDDEN_ELEMENTS = "script iframe form noscript".split(" ")
8
9
export default class HTMLSanitizer extends BasicObject {
10
static setHTML(element, html) {
11
- element.innerHTML = new this(html).sanitize().getHTML()
+ const sanitizedElement = new this(html).sanitize()
12
+ const sanitizedHtml = sanitizedElement.getHTML ? sanitizedElement.getHTML() : sanitizedElement.outerHTML
13
+ element.innerHTML = sanitizedHtml
14
}
15
16
static sanitize(html, options) {
0 commit comments