1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 17:57:58 +01:00

fix space stripping of urls

This commit is contained in:
Martin Stubenschrott
2009-03-30 17:53:57 +02:00
parent 93df18885a
commit 26ad70541a

View File

@@ -671,7 +671,7 @@ const util = { //{{{
let proto = url.match(/^([-\w]+):/); let proto = url.match(/^([-\w]+):/);
if (proto && Cc["@mozilla.org/network/protocol;1?name=" + proto[1]]) if (proto && Cc["@mozilla.org/network/protocol;1?name=" + proto[1]])
// Handle as URL, but remove spaces. Useful for copied/'p'asted URLs. // Handle as URL, but remove spaces. Useful for copied/'p'asted URLs.
return url.replace(/\s+/g, ""); return url.replace(/\s*\n+\s*/g, "");
// Ok, not a valid proto. If it looks like URL-ish (foo.com/bar), // Ok, not a valid proto. If it looks like URL-ish (foo.com/bar),
// let Gecko figure it out. // let Gecko figure it out.