chore: you saw nothing

This commit is contained in:
MiniDigger | Martin 2024-11-24 19:46:33 +01:00
parent 3906ae8c2e
commit 03f48a6eae
2 changed files with 0 additions and 8 deletions

View File

@ -78,7 +78,6 @@ const renderer = {
}
},
link({ href, title, tokens }) {
console.log("link", href, title, tokens, linkout(href));
return `<a href="${linkout(href)}"` + (title ? ` title="${title}">` : ">") + this.parser?.parseInline(tokens) + "DUM</a>";
},
} satisfies Partial<Renderer>;

View File

@ -9,31 +9,24 @@ const isSafeHost = (host: string) => {
};
const isSafe = (urlString: string) => {
console.log("safe?", urlString, useBackendData.security.safeDownloadHosts);
if (!urlString) {
console.log("1");
return false;
}
if (urlString.startsWith("#") || urlString.startsWith("/")) {
console.log("2");
return true;
}
try {
const url = new URL(urlString);
const host = url.hostname;
if (url.protocol?.startsWith("mailto")) {
console.log("3");
return true;
} else if (!host || isSafeHost(host)) {
console.log("4");
return true;
}
} catch {
console.log("5");
return false;
}
console.log("6");
return false;
};