findUrl: don't match non-:// URLs

Although "x:5" could theoretically be a URL with scheme "x" and path
"5", it probably isn't. Only URLify strings that use the "authority"
syntax ("foo://"). (No one ever types out "mailto:" URLs in ordinary
text, so we don't want to match those either.)

https://bugzilla.gnome.org/show_bug.cgi?id=636252
This commit is contained in:
Dan Winship 2011-04-13 09:18:37 -04:00
parent 92a85071bc
commit 563221698c

View File

@ -14,7 +14,7 @@ const _notTrailingJunk = '[^\\s`!()\\[\\]{};:\'\\".,<>?\u00AB\u00BB\u201C\u201D\
const _urlRegexp = new RegExp(
'\\b(' +
'(?:' +
'[a-z][\\w-]+:(?:/{1,3}|[a-z0-9%])' + // scheme:data
'[a-z][\\w-]+://' + // scheme://
'|' +
'www\\d{0,3}[.]' + // www.
'|' +