1
0
mirror of https://github.com/elk-zone/elk synced 2024-11-27 14:28:10 +09:00

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

This commit is contained in:
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

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>`
})