mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-08-29 18:07:42 +09:00
Polish
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user