Skip to content

Commit

Permalink
feat: add support for mermaid content wrapped with Markdown code bloc…
Browse files Browse the repository at this point in the history
…ks (#333)
  • Loading branch information
mmfei authored Jan 20, 2024
1 parent 559137d commit 8c64adc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions layouts/partials/third-party/mermaid.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

<script src="{{ $src }}"></script>
<script>
// Replace mermaid pre.code to div
Array.from(document.getElementsByClassName("language-mermaid")).forEach(
(el) => {
el.parentElement.outerHTML = `<div class="mermaid">${el.innerText}</div>`;
}
);
const mermaidConfig = {
startOnLoad: true,
flowchart: {
Expand Down

0 comments on commit 8c64adc

Please sign in to comment.