feat: mermaid shortcode support code block inside

This commit is contained in:
st1020 2023-10-22 22:15:53 +08:00
parent aa98b6e5e2
commit 64580f4df0
2 changed files with 42 additions and 11 deletions

View file

@ -134,6 +134,18 @@ Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and ot
## Mermaid
{% mermaid() %}
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
{% end %}
{% mermaid() %}
```
sequenceDiagram
participant Alice
participant Bob
@ -145,6 +157,25 @@ Note right of John: Rational thoughts <br/>prevail!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
```
{% end %}
{% mermaid() %}
```mermaid
gitGraph
commit
commit
branch develop
commit
commit
commit
checkout main
commit
commit
```
{% end %}
## Admonition

View file

@ -1,3 +1,3 @@
<pre class="mermaid bg-white">
{{ body }}
{{ body | trim_start_matches(pat="```mermaid") | trim_start_matches(pat="```") | trim_end_matches(pat="```") }}
</pre>