fix mermaid diagram rendering

closes #69
This commit is contained in:
Ole Mussmann 2025-01-25 21:06:35 +01:00
parent 157ca6fdb0
commit 8def1b3e59
2 changed files with 3 additions and 2 deletions

View file

@ -1,4 +1,4 @@
<pre class="mermaid">
{{- .Inner | safeHTML }}
{{- .Inner | htmlEscape | safeHTML }}
</pre>
{{ .Page.Store.Set "hasMermaid" true }}
{{ .Page.Store.Set "hasMermaid" true }}

View file

@ -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";