fix: use global regex to escape backticks (#1253)
parent
8d3be0f3cf
commit
08eebb651d
|
@ -89,7 +89,7 @@ export function parseMastodonHTML(
|
||||||
const code = htmlToText(raw)
|
const code = htmlToText(raw)
|
||||||
.replace(/</g, '<')
|
.replace(/</g, '<')
|
||||||
.replace(/>/g, '>')
|
.replace(/>/g, '>')
|
||||||
.replace(/`/, '`')
|
.replace(/`/g, '`')
|
||||||
const classes = lang ? ` class="language-${lang}"` : ''
|
const classes = lang ? ` class="language-${lang}"` : ''
|
||||||
return `><pre><code${classes}>${code}</code></pre>`
|
return `><pre><code${classes}>${code}</code></pre>`
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue