fix: handle html within markdown

pull/116/head
Daniel Roe 2022-11-25 21:09:03 +00:00
rodzic c9ae7cf942
commit 7d28f6ddbc
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 22D5008E4F5D9B55
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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`