diff --git a/src/plugins/links.js b/src/plugins/links.js index c7545189ea8..293858bbe94 100644 --- a/src/plugins/links.js +++ b/src/plugins/links.js @@ -158,6 +158,11 @@ export function linkClicking() { click: (view, event) => { const linkEl = event.target.closest('a') if (event.button === 0 && linkEl) { + // No special handling in mermaid diagrams to not break links there + if (linkEl.closest('svg[id^="mermaid-view"]')) { + return false + } + event.preventDefault() if (isLinkToSelfWithHash(linkEl.attributes.href?.value)) { // Open anchor links directly