What steps will reproduce the problem?
1. Throw some text at
`goog.string.linkifier.findFirstUrl/linkifyPlainText`
with with URLs formed like "<http://google.com/>" or
"(www.yahoo.com)" (note the ')' and '>' characters).
What is the expected output? What do you see instead?
Expected output is for 'http://google.com/' to be linked, as well as
'www.yahoo.com'. Instead, 'http://google.com/>' and 'www.yahoo.com)'
will be linked, respectively.
What version of the product are you using? On what operating system?
Closure Library r2118, Firefox 14.0.1, Mac OSX 10.7.2.
Please provide any additional information below.
This is a result of an erroneous character class in
goog.string.linkify.ACCEPTABLE_URL_CHARS_, '#-@' when it seems the
author intended '#\\-@', escaping the hyphen. I came to this
conclusion because other characters are included in the character
class which are included in the #-@ range. A quick test to see them
all:
for (var i = String.charCodeAt('#'), l = String.charCodeAt('@');
i < l; i++)
console.log(
String.fromCharCode(i),
/\w/.test(String.fromCharCode(i))
);
I've attached a patch for this with the fix and a test case (I've
already submitted the CLA).
Original issue reported on code.google.com by thomasma...@gmail.com on 23 Aug 2012 at 6:47
Original issue reported on code.google.com by
thomasma...@gmail.com
on 23 Aug 2012 at 6:47Attachments: