mirror of
https://github.com/zadam/trilium.git
synced 2025-12-20 15:19:56 +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.
|
// Apply syntax highlight.
|
||||||
for (const codeEl of document.querySelectorAll("pre code")) {
|
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);
|
const highlightResult = highlightAuto(codeEl.innerText);
|
||||||
codeEl.innerHTML = highlightResult.value;
|
codeEl.innerHTML = highlightResult.value;
|
||||||
codeEl.classList.add("hljs");
|
codeEl.classList.add("hljs");
|
||||||
|
|||||||
Reference in New Issue
Block a user