Skip to content

Commit

Permalink
Merge pull request #6575 from nextcloud/fix/mermaid_links
Browse files Browse the repository at this point in the history
fix(mermaid): No custom link handling for links in mermaid diagrams
  • Loading branch information
mejo- authored Oct 30, 2024
2 parents ed138a8 + 4cd57d6 commit 6f808ba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/plugins/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f808ba

Please sign in to comment.