You've already forked AstralRinth
forked from didirus/AstralRinth
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:
@@ -2,8 +2,17 @@ import Vue from 'vue'
|
|||||||
import xss from 'xss'
|
import xss from 'xss'
|
||||||
import marked from 'marked'
|
import marked from 'marked'
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
whiteList: {
|
||||||
|
...xss.whiteList,
|
||||||
|
summary: [],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
const configuredXss = new xss.FilterXSS(options)
|
||||||
|
|
||||||
function compileMarkdown(target, markdown) {
|
function compileMarkdown(target, markdown) {
|
||||||
target.innerHTML = xss(marked(markdown))
|
target.innerHTML = configuredXss.process(marked(markdown))
|
||||||
}
|
}
|
||||||
|
|
||||||
Vue.directive('compiled-markdown', {
|
Vue.directive('compiled-markdown', {
|
||||||
|
|||||||
Reference in New Issue
Block a user