mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-10-17 20:20:40 +08:00
Add more link protocol support
This commit is contained in:
parent
c907b288bd
commit
7f0d675ab8
@ -259,8 +259,8 @@ function goToLinkExt(evt, hrefLink, $link) {
|
|||||||
// Enable protocols supported by CKEditor 5 to be clickable.
|
// 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.
|
// 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.
|
// Adding `:` to these links might be safer.
|
||||||
const otherAllowedProtocols = ['mailto:', 'tel:', 'sms:', 'sftp:', 'smb:', 'slack:', 'file:', 'zotero:'];
|
const otherAllowedProtocols = ['mailto:', 'tel:', 'sms:', 'sftp:', 'smb:', 'slack:', 'zotero:'];
|
||||||
if (otherAllowedProtocols.some(protocol => hrefLink.startsWith(protocol))){
|
if (otherAllowedProtocols.some(protocol => hrefLink.toLowerCase().startsWith(protocol))){
|
||||||
window.open(hrefLink, '_blank');
|
window.open(hrefLink, '_blank');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user