mirror of
https://github.com/requarks/wiki.git
synced 2026-08-17 16:24:47 -05:00
fix: stop dompurify from breaking draw.io diagrams (#7888)
Newer versions of dompurify strip <foreignobject> tags if not explicitly allowed. See https://github.com/cure53/DOMPurify/issues/1040 Fixes #7744
This commit is contained in:
@@ -228,7 +228,8 @@ export default {
|
||||
})
|
||||
|
||||
this.previewHTML = DOMPurify.sanitize($.html(), {
|
||||
ADD_TAGS: ['foreignObject']
|
||||
ADD_TAGS: ['foreignObject'],
|
||||
HTML_INTEGRATION_POINTS: { foreignobject: true }
|
||||
})
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -454,7 +454,8 @@ export default {
|
||||
// this.$store.set('editor/content', newContent)
|
||||
this.processMarkers(this.cm.firstLine(), this.cm.lastLine())
|
||||
this.previewHTML = DOMPurify.sanitize(md.render(newContent), {
|
||||
ADD_TAGS: ['foreignObject']
|
||||
ADD_TAGS: ['foreignObject'],
|
||||
HTML_INTEGRATION_POINTS: { foreignobject: true }
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
tabsetHelper.format()
|
||||
|
||||
@@ -34,7 +34,8 @@ module.exports = {
|
||||
|
||||
input = DOMPurify.sanitize(input, {
|
||||
ADD_ATTR: allowedAttrs,
|
||||
ADD_TAGS: allowedTags
|
||||
ADD_TAGS: allowedTags,
|
||||
HTML_INTEGRATION_POINTS: { foreignobject: true }
|
||||
})
|
||||
}
|
||||
return input
|
||||
|
||||
Reference in New Issue
Block a user