Skip to content

Commit

Permalink
dump: Fix Mermaid to work by specifying the version of Mermaid
Browse files Browse the repository at this point in the history
After Mermaid v10, the function 'mermaid.render'
does not support callback, but only supports async operation.

Due to this change, an issue has arisen where JavaScript in
the HTML document created via the 'uftrace dump --mermaid'
command fails to function as expected.

This commit fixed the Mermaid to work by temporarily
specifying the version of Mermaid as v9.

Fixed: #1793

Signed-off-by: Seong Jin Kim <mirusu400@naver.com>
  • Loading branch information
mirusu400 authored and honggyukim committed Aug 7, 2023
1 parent c9aac71 commit e1de5c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmds/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@ static void dump_mermaid_footer(struct uftrace_dump_ops *ops, struct uftrace_dat
pr_out("flowchart TB\n");
print_graph_node_mermaid(&mermaid_graph, &mermaid_graph.root);
pr_out("</div>\n");
pr_out("<script src=\"https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js\"></script>\n");
pr_out("<script src=\"https://cdn.jsdelivr.net/npm/mermaid@9/dist/mermaid.min.js\"></script>\n");
pr_out("<script>\n");
pr_out("var config = {\n");
pr_out(" startOnLoad: true,\n");
Expand Down

0 comments on commit e1de5c1

Please sign in to comment.