1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-23 18:53:36 +02:00

All: fixes #5801: Links in flowchart Mermaid diagrams (#5830)

This commit is contained in:
Helmut K. C. Tessarek 2021-12-13 05:38:12 -05:00 committed by GitHub
parent 7fa278f875
commit c499473467
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -202,6 +202,8 @@ document.addEventListener('click', function(event) {
if (webviewLib.handleInternalLink(event, anchor)) return; if (webviewLib.handleInternalLink(event, anchor)) return;
event.preventDefault(); event.preventDefault();
if (anchor.getAttribute('href')) webviewLib.options_.postMessage(anchor.getAttribute('href')); if (anchor.getAttribute('href')) webviewLib.options_.postMessage(anchor.getAttribute('href'));
// Depending on the chart type, the generated SVG contains an anchor element with xlink:href attribute.
if (anchor.getAttribute('xlink:href')) webviewLib.options_.postMessage(anchor.getAttribute('xlink:href'));
return; return;
} }

View File

@ -104,6 +104,8 @@ document.addEventListener('click', function(event) {
if (webviewLib.handleInternalLink(event, anchor)) return; if (webviewLib.handleInternalLink(event, anchor)) return;
event.preventDefault(); event.preventDefault();
if (anchor.getAttribute('href')) webviewLib.options_.postMessage(anchor.getAttribute('href')); if (anchor.getAttribute('href')) webviewLib.options_.postMessage(anchor.getAttribute('href'));
// Depending on the chart type, the generated SVG contains an anchor element with xlink:href attribute.
if (anchor.getAttribute('xlink:href')) webviewLib.options_.postMessage(anchor.getAttribute('xlink:href'));
return; return;
} }