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 = "";
for (let url of urls) {
// Chrome likes to give us the URL twice with a \n
const lines = url.split("\n");
url = lines[0];
url = url.split("\n")[0].trim();
text += await urlToLink(url, allowedSuffixes);
}
return text;