Skip to content

Commit

Permalink
Add more link protocol support
Browse files Browse the repository at this point in the history
  • Loading branch information
SiriusXT committed Nov 14, 2024
1 parent c907b28 commit 7f0d675
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/public/app/services/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ function goToLinkExt(evt, hrefLink, $link) {
// 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:', 'file:', 'zotero:'];
if (otherAllowedProtocols.some(protocol => hrefLink.startsWith(protocol))){
const otherAllowedProtocols = ['mailto:', 'tel:', 'sms:', 'sftp:', 'smb:', 'slack:', 'zotero:'];
if (otherAllowedProtocols.some(protocol => hrefLink.toLowerCase().startsWith(protocol))){
window.open(hrefLink, '_blank');
}
}
Expand Down

0 comments on commit 7f0d675

Please sign in to comment.