mermaid export button WIP

This commit is contained in:
zadam
2022-07-29 00:32:28 +02:00
parent ef6b7a85d5
commit 6c43b92bf1
4 changed files with 79 additions and 20 deletions

View File

@@ -85,11 +85,16 @@ function getNotePathFromLink($link) {
}
function goToLink(e) {
const $link = $(e.target).closest("a,.block-link");
const address = $link.attr('href');
if (address.startsWith("data:")) {
return true;
}
e.preventDefault();
e.stopPropagation();
const $link = $(e.target).closest("a,.block-link");
const notePath = getNotePathFromLink($link);
if (notePath) {
@@ -115,8 +120,6 @@ function goToLink(e) {
|| $link.hasClass("ck-link-actions__preview") // within edit link dialog single click suffices
|| $link.closest("[contenteditable]").length === 0 // outside of CKEditor single click suffices
) {
const address = $link.attr('href');
if (address) {
if (address.toLowerCase().startsWith('http')) {
window.open(address, '_blank');