Trim leading/trailing whitespace from URL

Windows likes to add extra newlines...
This commit is contained in:
Abdo 2025-06-28 16:42:12 +03:00
parent 33fb6bf400
commit 0bdeab974f

View file

@ -244,8 +244,7 @@ async function processUrls(
let text = ""; let text = "";
for (let url of urls) { for (let url of urls) {
// Chrome likes to give us the URL twice with a \n // Chrome likes to give us the URL twice with a \n
const lines = url.split("\n"); url = url.split("\n")[0].trim();
url = lines[0];
text += await urlToLink(url, allowedSuffixes); text += await urlToLink(url, allowedSuffixes);
} }
return text; return text;