added support for external protocols
This commit is contained in:
parent
e94cd88d63
commit
70982f81c1
|
|
@ -59,6 +59,7 @@
|
||||||
- **Drag to link** - Drag notes or images into the editor to insert links
|
- **Drag to link** - Drag notes or images into the editor to insert links
|
||||||
- **Click to navigate** - Jump between notes seamlessly
|
- **Click to navigate** - Jump between notes seamlessly
|
||||||
- **External links** - Open in new tabs automatically
|
- **External links** - Open in new tabs automatically
|
||||||
|
- **URI protocols** - Supports `mailto:`, `tel:`, `ssh:`, `ftp:`, `slack:`, `discord:`, `teams:`, `zoom:`, `whatsapp:`, `telegram:`, `signal:`, `spotify:`, `steam:`, `magnet:`, and more
|
||||||
|
|
||||||
### Outline Panel
|
### Outline Panel
|
||||||
- **Table of Contents** - View all headings (H1-H6) in sidebar
|
- **Table of Contents** - View all headings (H1-H6) in sidebar
|
||||||
|
|
|
||||||
|
|
@ -2580,7 +2580,9 @@ function noteApp() {
|
||||||
if (!href) return;
|
if (!href) return;
|
||||||
|
|
||||||
// Check if it's an external link or API path (media files, etc.)
|
// Check if it's an external link or API path (media files, etc.)
|
||||||
if (href.startsWith('http://') || href.startsWith('https://') || href.startsWith('//') || href.startsWith('mailto:') || href.startsWith('/api/')) {
|
// Safe external protocols: http, https, mailto, tel, ssh, ftp, sftp, and app deep links
|
||||||
|
const externalProtocols = ['http://', 'https://', '//', 'mailto:', 'tel:', 'ssh:', 'ftp:', 'sftp:', 'slack:', 'discord:', 'teams:', 'vscode:', 'zoom:', 'whatsapp:', 'telegram:', 'signal:', 'spotify:', 'steam:', 'magnet:', '/api/'];
|
||||||
|
if (externalProtocols.some(p => href.startsWith(p))) {
|
||||||
return; // Let external links and API paths work normally
|
return; // Let external links and API paths work normally
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue