diff --git a/cypress/platform/click_security_loose.html b/cypress/platform/click_security_loose.html index ed9fcaaa8..625d34052 100644 --- a/cypress/platform/click_security_loose.html +++ b/cypress/platform/click_security_loose.html @@ -13,39 +13,39 @@
+graph TB FunctionTest1-->URLTest1 click FunctionTest1 clickByFlow "Add a div" click URLTest1 "http://localhost:9000/webpackUsage.html" "Visit mermaid docs"-+graph TB 1Function--->2URL click 1Function clickByFlow "Add a div" click 2URL "http://localhost:9000/webpackUsage.html" "Visit mermaid docs"-+flowchart TB FunctionTest2-->URLTest2 click FunctionTest2 clickByFlow "Add a div" click URLTest2 "http://localhost:9000/webpackUsage.html" "Visit mermaid docs" _self-+flowchart TB 10Function--->20URL click 10Function clickByFlow "Add a div" click 20URL "http://localhost:9000/webpackUsage.html" "Visit mermaid docs" _self-+classDiagram class ShapeLink link ShapeLink "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link" class ShapeCallback callback ShapeCallback "clickByClass" "This is a tooltip for a callback"-+classDiagram-v2 class ShapeLink2 link ShapeLink2 "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link" @@ -95,20 +95,20 @@ Add another diagram to demo page : 48h-+graph TB FunctionArgTest2-->URL click FunctionArgTest2 call clickByFlowArg(ARGUMENT) "Add a div" click URL "http://localhost:9000/webpackUsage.html" "Visit mermaid docs"-+flowchart TB 2FunctionArg-->URL click 2FunctionArg call clickByFlowArg(ARGUMENT) "Add a div" click URL "http://localhost:9000/webpackUsage.html" "Visit mermaid docs"-+classDiagram class ShapeLink link ShapeLink "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link" @@ -116,7 +116,7 @@ click ShapeCallback call clickByClass(123) "This is a tooltip for a callback"-+classDiagram-v2 class ShapeLink2 link ShapeLink2 "http://localhost:9000/webpackUsage.html" "This is a tooltip for a link" diff --git a/packages/mermaid/src/mermaid.ts b/packages/mermaid/src/mermaid.ts index 6a709dd32..391af3283 100644 --- a/packages/mermaid/src/mermaid.ts +++ b/packages/mermaid/src/mermaid.ts @@ -45,7 +45,7 @@ import { isDetailedError } from './utils'; * @param nodes * @param callback */ -const init = function ( +const init = async function ( config?: MermaidConfig, // eslint-disable-next-line no-undef nodes?: string | HTMLElement | NodeListOf, @@ -69,7 +69,7 @@ const init = function ( } }; -const initThrowsErrors = function ( +const initThrowsErrors = async function ( config?: MermaidConfig, // eslint-disable-next-line no-undef nodes?: string | HTMLElement | NodeListOf , @@ -108,7 +108,7 @@ const initThrowsErrors = function ( // generate the id of the diagram const idGenerator = new utils.initIdGenerator(conf.deterministicIds, conf.deterministicIDSeed); - let txt; + let txt: string; const errors = []; // element is the current div with mermaid class @@ -136,7 +136,7 @@ const initThrowsErrors = function ( log.debug('Detected early reinit: ', init); } try { - mermaidAPI.render( + await mermaidAPI.render( id, txt, (svgCode: string, bindFunctions?: (el: Element) => void) => {