fix: use global regex to escape backticks (#1253)
This commit is contained in:
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 a new issue