forked from oruelle/md_mermaid
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(markdown_mermaid.js)!: generate <pre class="mermaid"></pre> inst…
…ead of <div class="mermaid"></div> Original html tag might break mermaid graph see oruelle#16
- Loading branch information
Showing
4 changed files
with
13 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
tests/test_markdown_mermaid/test_add_mermaid_script_and_tag_input_file_path0_.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
"# Title\n\n\n\nSome text.\n\n\n\n<div class=\"mermaid\">\ngraph TB\n\n A --> B\n\ | ||
\n B --> C\n\n</div>\n\n\nSome other text.\n\n\n\n<div class=\"mermaid\">\ngraph\ | ||
\ TB\n\n D --> E\n\n E --> F\n\n</div>\n\n\n\n\nEnd of the file\n\n\n<script\ | ||
"# Title\n\n\n\nSome text.\n\n\n\n<pre class=\"mermaid\">\ngraph TB\n\n A --> B\n\ | ||
\n B --> C\n\n</pre>\n\n\nSome other text.\n\n\n\n<pre class=\"mermaid\">\ngraph\ | ||
\ TB\n\n D --> E\n\n E --> F\n\n</pre>\n\n\n\n\nEnd of the file\n\n\n<script\ | ||
\ type=\"module\">\n import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';\n\ | ||
\ mermaid.initialize({ startOnLoad: true });\n</script>\n" |
8 changes: 4 additions & 4 deletions
8
tests/test_markdown_mermaid/test_add_mermaid_script_and_tag_with_icons_input_file_path0_.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
"# Title\n\n\n\nTesting 'registerIconPacks' as used by https://mermaid.js.org/syntax/architecture.html.\n\ | ||
\n\n\n<div class=\"mermaid\">\narchitecture-beta\n\n group api(logos:aws-lambda)[API]\n\ | ||
\n\n\n<pre class=\"mermaid\">\narchitecture-beta\n\n group api(logos:aws-lambda)[API]\n\ | ||
\n\n\n service db(logos:aws-aurora)[Database] in api\n\n service disk1(logos:aws-glacier)[Storage]\ | ||
\ in api\n\n service disk2(logos:aws-s3)[Storage] in api\n\n service server(logos:aws-ec2)[Server]\ | ||
\ in api\n\n\n\n db:L -- R:server\n\n disk1:T -- B:server\n\n disk2:T --\ | ||
\ B:db\n\n</div>\n\n\nIt only supports full url lazy-loading: https://mermaid.js.org/config/icons.html\n\ | ||
\n\n\n<div class=\"mermaid\">\narchitecture-beta\n\n group api(logos:aws-lambda)[API]\n\ | ||
\ B:db\n\n</pre>\n\n\nIt only supports full url lazy-loading: https://mermaid.js.org/config/icons.html\n\ | ||
\n\n\n<pre class=\"mermaid\">\narchitecture-beta\n\n group api(logos:aws-lambda)[API]\n\ | ||
\n\n\n service db(logos:aws-aurora)[Database] in api\n\n service disk1(logos:aws-glacier)[Storage]\ | ||
\ in api\n\n service disk2(logos:aws-s3)[Storage] in api\n\n service server(logos:aws-ec2)[Server]\ | ||
\ in api\n\n\n\n db:L -- R:server\n\n disk1:T -- B:server\n\n disk2:T --\ | ||
\ B:db\n\n</div>\n\n\n\n\nEnd of the file\n\n\n<script type=\"module\">\n import\ | ||
\ B:db\n\n</pre>\n\n\n\n\nEnd of the file\n\n\n<script type=\"module\">\n import\ | ||
\ mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';\n\ | ||
mermaid.registerIconPacks([\n { name: 'logos', loader: () => fetch('https://unpkg.com/@iconify-json/logos@1/icons.json').then((res)\ | ||
\ => res.json()) }\n]);\n mermaid.initialize({ startOnLoad: true });\n</script>\n" |