fix: handle html within markdown
parent
c9ae7cf942
commit
7d28f6ddbc
|
@ -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 New Issue