This commit is contained in:
Stanko K.R.
2026-07-20 15:35:13 +02:00
parent 797efa54fd
commit a3d2939569
5 changed files with 65 additions and 19 deletions
+7 -6
View File
@@ -77,14 +77,15 @@ export default class MessageFormatter {
#highlightCodeBlock(block) {
this.#normalizeLineBreaks(block)
if (!this.#isPlainText(block)) return
const language = block.dataset.language
if (language && window.hljs.getLanguage(language)) {
block.classList.add(`language-${language}`)
if (this.#isPlainText(block)) {
const language = block.dataset.language
if (language && window.hljs.getLanguage(language)) {
block.classList.add(`language-${language}`)
}
window.hljs.highlightElement(block)
}
window.hljs.highlightElement(block)
}
// Lexxy breaks code block lines with <br>, Trix-era blocks used newlines