fix: handle html within markdown

zio/stable
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
1 changed files with 1 additions and 1 deletions

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`