forked from Mirrors/elk
fix: handle html within markdown
This commit is contained in:
parent
c9ae7cf942
commit
7d28f6ddbc
1 changed files with 1 additions and 1 deletions
|
@ -47,7 +47,7 @@ function handleNode(el: Element) {
|
||||||
return handleBlocks(el) || handleMention(el) || el
|
return handleBlocks(el) || handleMention(el) || el
|
||||||
}
|
}
|
||||||
|
|
||||||
const md = new MarkdownIt()
|
const md = new MarkdownIt({ html: true })
|
||||||
md.renderer.rules.fence = (tokens, idx) => {
|
md.renderer.rules.fence = (tokens, idx) => {
|
||||||
const token = tokens[idx]
|
const token = tokens[idx]
|
||||||
return `<custom-code lang="${token.info.trim().toLowerCase() || ''}" code="${encodeURIComponent(token.content)}"></custom-code>\n`
|
return `<custom-code lang="${token.info.trim().toLowerCase() || ''}" code="${encodeURIComponent(token.content)}"></custom-code>\n`
|
||||||
|
|
Loading…
Reference in a new issue