diff --git a/src/public/app/services/link.js b/src/public/app/services/link.js index cee987305..ed39563bc 100644 --- a/src/public/app/services/link.js +++ b/src/public/app/services/link.js @@ -254,8 +254,15 @@ function goToLinkExt(evt, hrefLink, $link) { window.open(hrefLink, '_blank'); } else if (hrefLink.toLowerCase().startsWith('file:') && utils.isElectron()) { const electron = utils.dynamicRequire('electron'); - electron.shell.openPath(hrefLink); + } else { + // Enable protocols supported by CKEditor 5 to be clickable. + // Refer to `allowedProtocols` in https://github.com/TriliumNext/trilium-ckeditor5/blob/main/packages/ckeditor5-build-balloon-block/src/ckeditor.ts. + // Adding `:` to these links might be safer. + const otherAllowedProtocols = ['mailto:', 'tel:', 'sms:', 'sftp:', 'smb:', 'slack:', 'zotero:']; + if (otherAllowedProtocols.some(protocol => hrefLink.toLowerCase().startsWith(protocol))){ + window.open(hrefLink, '_blank'); + } } } } diff --git a/src/public/app/widgets/find.js b/src/public/app/widgets/find.js index 5c24c36fa..a3c9124c2 100644 --- a/src/public/app/widgets/find.js +++ b/src/public/app/widgets/find.js @@ -5,6 +5,7 @@ import { t } from "../services/i18n.js"; import NoteContextAwareWidget from "./note_context_aware_widget.js"; +import attributeService from "../services/attributes.js"; import FindInText from "./find_in_text.js"; import FindInCode from "./find_in_code.js"; import FindInHtml from "./find_in_html.js"; @@ -16,27 +17,26 @@ const waitForEnter = (findWidgetDelayMillis < 0); // the focusout handler is called with relatedTarget equal to the label instead // of undefined. It's -1 instead of > 0, so they don't tabstop const TPL = ` -