Skip to content

Commit

Permalink
fix mermaid diagram rendering
Browse files Browse the repository at this point in the history
closes #69
  • Loading branch information
Ole Mussmann committed Jan 25, 2025
1 parent 157ca6f commit 8def1b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions layouts/_default/_markup/render-codeblock-mermaid.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<pre class="mermaid">
{{- .Inner | safeHTML }}
{{- .Inner | htmlEscape | safeHTML }}
</pre>
{{ .Page.Store.Set "hasMermaid" true }}
{{ .Page.Store.Set "hasMermaid" true }}
1 change: 1 addition & 0 deletions static/js/copy-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 8def1b3

Please sign in to comment.