Skip to content

Commit 0e25eab

Browse files
authored
Merge branch 'main' into jm/eslint-prettier
2 parents 1af330b + 42dced4 commit 0e25eab

File tree

2 files changed

+3
-24
lines changed

2 files changed

+3
-24
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@interledger/docs-design-system",
3-
"version": "0.10.2",
3+
"version": "0.10.1",
44
"type": "module",
55
"description": "Shared styles and components used across all Interledger Starlight documentation sites",
66
"exports": {

src/components/Mermaid.astro

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,6 @@ const { graph, hasBorder = false } = Astro.props
2929
</style>
3030

3131
<script>
32-
import mermaid from '/node_modules/mermaid/dist/mermaid.esm.min.mjs'
33-
mermaid.initialize({ startOnLoad: false })
34-
35-
const mermaidElements = document.querySelectorAll('pre.mermaid')
36-
37-
function unescapeHTML(str) {
38-
return str
39-
.replaceAll('&gt;', '>')
40-
.replaceAll('&lt;', '<')
41-
.replaceAll('&amp;', '&')
42-
}
43-
44-
async function drawDiagram(mermaidElement) {
45-
let graphDefinition = mermaidElement.innerHTML
46-
graphDefinition = unescapeHTML(graphDefinition)
47-
const id = `graphDiv${Math.floor(Math.random() * 10000)}`
48-
const { svg } = await mermaid.render(id, graphDefinition)
49-
mermaidElement.innerHTML = svg
50-
}
51-
52-
for (const mermaidElement of mermaidElements) {
53-
await drawDiagram(mermaidElement)
54-
}
32+
import mermaid from "/node_modules/mermaid/dist/mermaid.esm.min.mjs";
33+
mermaid.initialize({ startOnLoad: true });
5534
</script>

0 commit comments

Comments
 (0)