fix: handle html within markdown

This commit is contained in:
Daniel Roe 2022-11-25 21:09:03 +00:00
parent c9ae7cf942
commit 7d28f6ddbc
No known key found for this signature in database
GPG key ID: 22D5008E4F5D9B55

View file

@ -47,7 +47,7 @@ function handleNode(el: Element) {
return handleBlocks(el) || handleMention(el) || el
}
const md = new MarkdownIt()
const md = new MarkdownIt({ html: true })
md.renderer.rules.fence = (tokens, idx) => {
const token = tokens[idx]
return `<custom-code lang="${token.info.trim().toLowerCase() || ''}" code="${encodeURIComponent(token.content)}"></custom-code>\n`