fix: html tag escaping issue in plugin

pull/2165/head
李江辰 3 years ago
parent b697631368
commit 1d65fd5438

@ -22,8 +22,7 @@ export const colorPreviewPlugin = (md: MarkdownIt) => {
md.renderer.rules.text = (tokens, idx) => {
let text = tokens[idx].content
text = text.replace(COLOR_REGEX, replaceColor)
return text
text = md.utils.escapeHtml(text)
return text.replace(COLOR_REGEX, replaceColor)
}
}

Loading…
Cancel
Save