fix: use global regex to escape backticks (#1253)

zio/stable
Svyatoslav Kryukov 2023-01-17 14:26:36 +03:00 committed by GitHub
parent 8d3be0f3cf
commit 08eebb651d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ export function parseMastodonHTML(
const code = htmlToText(raw)
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/`/, '&#96;')
.replace(/`/g, '&#96;')
const classes = lang ? ` class="language-${lang}"` : ''
return `><pre><code${classes}>${code}</code></pre>`
})