diff --git a/cypress/integration/rendering/flowchart.spec.js b/cypress/integration/rendering/flowchart.spec.js
index 4ea4cbcee..caf467e12 100644
--- a/cypress/integration/rendering/flowchart.spec.js
+++ b/cypress/integration/rendering/flowchart.spec.js
@@ -524,4 +524,24 @@ describe('Flowchart', () => {
{ flowchart: { htmlLabels: false } }
);
});
+
+ it('24: Handle link click events (link, anchor, mailto, other protocol, script)', () => {
+ imgSnapshotTest(
+ `graph TB
+ TITLE["Link Click Events
(click the nodes below)"]
+ A[link test]
+ B[anchor test]
+ C[mailto test]
+ D[other protocol test]
+ E[script test]
+ TITLE --> A & B & C & D & E
+ click A "https://mermaid-js.github.io/mermaid/#/" "link test"
+ click B "#link-clicked" "anchor test"
+ click C "mailto:user@user.user" "mailto test"
+ click D "notes://do-your-thing/id" "other protocol test"
+ click E "javascript:alert('test')" "script test"
+ `,
+ { securityLevel: 'loose' }
+ );
+ });
});
diff --git a/dist/index.html b/dist/index.html
index 2505d8010..0dab8c332 100644
--- a/dist/index.html
+++ b/dist/index.html
@@ -353,6 +353,21 @@ graph TB
linkStyle 1 stroke:greenyellow,stroke-width:2px
style C fill:greenyellow,stroke:green,stroke-width:4px
+