diff options
| author | Francesco Tomaselli <tomaselli.fr@gmail.com> | 2025-01-26 00:32:03 +0100 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-26 00:32:03 +0100 | 
| commit | c70f36a8c5e25efe3835574e55a02b5124149313 (patch) | |
| tree | 6609d20275d81e8114ae36a692ecaf057fd1f8fd | |
| parent | 22bfe56c1316437641509fb61c36b32048206662 (diff) | |
| parent | a9d730a4c801fba72570291409c8c82c126f157b (diff) | |
Merge pull request #70 from OleMussmann/main
Fix mermaid diagrams
| -rw-r--r-- | layouts/_default/_markup/render-codeblock-mermaid.html | 4 | ||||
| -rw-r--r-- | static/js/copy-code.js | 1 | 
2 files changed, 3 insertions, 2 deletions
| diff --git a/layouts/_default/_markup/render-codeblock-mermaid.html b/layouts/_default/_markup/render-codeblock-mermaid.html index bb7bf42..dcd9c98 100644 --- a/layouts/_default/_markup/render-codeblock-mermaid.html +++ b/layouts/_default/_markup/render-codeblock-mermaid.html @@ -1,4 +1,4 @@  <pre class="mermaid"> -  {{- .Inner | safeHTML }} +  {{- .Inner | htmlEscape | safeHTML }}  </pre> -{{ .Page.Store.Set "hasMermaid" true }}
\ No newline at end of file +{{ .Page.Store.Set "hasMermaid" true }} diff --git a/static/js/copy-code.js b/static/js/copy-code.js index 67fd936..2de3cda 100644 --- a/static/js/copy-code.js +++ b/static/js/copy-code.js @@ -2,6 +2,7 @@ document.addEventListener("DOMContentLoaded", function () {    const codeBlocks = document.querySelectorAll("pre");    codeBlocks.forEach((codeBlock) => { +    if (codeBlock.className == "mermaid") return;      const copyButton = document.createElement("button");      copyButton.className = "copy-code-button";      copyButton.textContent = "copy"; | 
