Fix summary tags being always escaped by XSS (#84)

* Fix summary tags being removed by XSS

* Follow falseresync's suggestion

Co-authored-by: joaoh1 <joaoh1@users.noreply.github.com>
This commit is contained in:
boredomh1
2021-01-21 18:40:09 -03:00
committed by GitHub
parent 1c1855f0c3
commit 3eed51dbac

View File

@@ -2,8 +2,17 @@ import Vue from 'vue'
import xss from 'xss'
import marked from 'marked'
const options = {
whiteList: {
...xss.whiteList,
summary: [],
},
}
const configuredXss = new xss.FilterXSS(options)
function compileMarkdown(target, markdown) {
target.innerHTML = xss(marked(markdown))
target.innerHTML = configuredXss.process(marked(markdown))
}
Vue.directive('compiled-markdown', {