mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 18:50:41 +01:00
fix(share): mermaid breaking in share (closes #7765)
This commit is contained in:
@@ -325,6 +325,11 @@ function renderText(result: Result, note: SNote | BNote) {
|
||||
|
||||
// Apply syntax highlight.
|
||||
for (const codeEl of document.querySelectorAll("pre code")) {
|
||||
if (codeEl.classList.contains("language-mermaid") && note.type === "text") {
|
||||
// Mermaid is handled on client-side, we don't want to break it by adding syntax highlighting.
|
||||
continue;
|
||||
}
|
||||
|
||||
const highlightResult = highlightAuto(codeEl.innerText);
|
||||
codeEl.innerHTML = highlightResult.value;
|
||||
codeEl.classList.add("hljs");
|
||||
|
||||
Reference in New Issue
Block a user