Skip to content

Commit

Permalink
Use latest API of Mermaid to render diagrams (#1430)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahus1 committed Sep 16, 2023
1 parent 9836809 commit 38fbb14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public BrowserPanel() {
myGoogleFontsCssLink = "<link rel=\"stylesheet\" data-default href=\"" + PreviewStaticServer.getStyleUrl("googlefonts/googlefonts.css") + "\">";
myDroidSansMonoCssLink = "<link rel=\"stylesheet\" data-default href=\"" + PreviewStaticServer.getStyleUrl("googlefonts/droidsansmono.css") + "\">";
myMermaidScript = "<script src=\"" + PreviewStaticServer.getScriptUrl("mermaid/mermaid.min.js") + "\"></script>" +
"<script>mermaid.init(); window.mermaid = mermaid; </script>";
"<script>mermaid.initialize(); window.mermaid = mermaid; </script>";
} catch (IOException e) {
String message = "Unable to combine CSS resources: " + e.getMessage();
log.error(message, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public void onLoadEnd(CefBrowser browser, CefFrame frame, int httpStatusCode) {
myDejavuCssLink = "<link rel=\"stylesheet\" data-default href=\"" + PreviewStaticServer.getStyleUrl("dejavu/dejavu.css") + "\">";
myGoogleFontsCssLink = "<link rel=\"stylesheet\" data-default href=\"" + PreviewStaticServer.getStyleUrl("googlefonts/googlefonts.css") + "\">";
myMermaidScript = "<script src=\"" + PreviewStaticServer.getScriptUrl("mermaid/mermaid.min.js") + "\"></script>" +
"<script>mermaid.init(); window.mermaid = mermaid; </script>";
"<script>mermaid.initialize(); window.mermaid = mermaid; </script>";
} catch (IOException e) {
String message = "Unable to combine CSS resources: " + e.getMessage();
LOG.error(message, e);
Expand Down Expand Up @@ -608,7 +608,7 @@ public synchronized void setHtml(@NotNull String htmlParam, @NotNull Map<String,
replaceResult = false;
getCefBrowser().executeJavaScript(
"function finish() {" +
"if (window.mermaid !== undefined) window.mermaid.init(); " +
"if (window.mermaid !== undefined) window.mermaid.run(); " +
"if ('__IntelliJTools' in window) {" +
"__IntelliJTools.processLinks && __IntelliJTools.processLinks();" +
"__IntelliJTools.processImages && __IntelliJTools.processImages();" +
Expand Down

0 comments on commit 38fbb14

Please sign in to comment.