1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 13:32:27 +01:00

remove spaces from strings which look like urls

This commit is contained in:
Martin Stubenschrott
2008-11-29 15:29:32 +00:00
parent 36b676d508
commit 3f6f53580f
2 changed files with 7 additions and 0 deletions

View File

@@ -470,6 +470,10 @@ const util = { //{{{
}
catch (e) {}
// removes spaces from the string if it starts with http:// or something like that
if (/^\w+:\/\//.test(urls[url]))
urls[url] = urls[url].replace(/\s+/g, "");
// strip each 'URL' - makes things simpler later on
urls[url] = urls[url].replace(/^\s+/, "").replace(/\s+$/, "");