You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-23 22:36:32 +02:00
Desktop: Allow attaching a file from the Markdown editor for HTML notes
This commit is contained in:
@@ -159,12 +159,14 @@ class HtmlUtils {
|
||||
.replace(/</g, '<');
|
||||
}
|
||||
|
||||
// This is tested in sanitize_links.md
|
||||
private isAcceptedUrl(url: string, allowedFilePrefixes: string[]): boolean {
|
||||
url = url.toLowerCase();
|
||||
if (url.startsWith('https://') ||
|
||||
url.startsWith('http://') ||
|
||||
url.startsWith('mailto://') ||
|
||||
url.startsWith('mailto:') ||
|
||||
url.startsWith('joplin://') ||
|
||||
!!url.match(/:\/[0-9a-zA-Z]{32}/) ||
|
||||
// We also allow anchors but only with a specific set of a characters.
|
||||
// Fixes https://github.com/laurent22/joplin/issues/8286
|
||||
!!url.match(/^#[a-zA-Z0-9-]+$/)) return true;
|
||||
|
||||
Reference in New Issue
Block a user