mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 17:42:27 +01:00
remove spaces from strings which look like urls
This commit is contained in:
3
NEWS
3
NEWS
@@ -16,6 +16,9 @@
|
|||||||
* IMPORTANT: renamed Startup and Quit autocmd events to VimperatorEnter and
|
* IMPORTANT: renamed Startup and Quit autocmd events to VimperatorEnter and
|
||||||
VimperatorLeave respectively
|
VimperatorLeave respectively
|
||||||
|
|
||||||
|
* remove spaces and newlines when open urls starting with http:// or similar
|
||||||
|
before :o http://linux .com would search for http://linux and for .com, now
|
||||||
|
it just opens linux.com. Also handy when pasting broken urls with p or P.
|
||||||
* add 'wildcase' option
|
* add 'wildcase' option
|
||||||
* 'linkbgcolor', 'linkfgcolor', ... have been replaced with highlight
|
* 'linkbgcolor', 'linkfgcolor', ... have been replaced with highlight
|
||||||
groups, HintElem and HintActive
|
groups, HintElem and HintActive
|
||||||
|
|||||||
@@ -470,6 +470,10 @@ const util = { //{{{
|
|||||||
}
|
}
|
||||||
catch (e) {}
|
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
|
// strip each 'URL' - makes things simpler later on
|
||||||
urls[url] = urls[url].replace(/^\s+/, "").replace(/\s+$/, "");
|
urls[url] = urls[url].replace(/^\s+/, "").replace(/\s+$/, "");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user