Bug 1274242 - Linkify should not stop at |. r=valentin
authorJorg K
Mon, 23 May 2016 05:45:00 +0200
changeset 323028 01cd683a67a6298e5adc628c9890662514ffad35
parent 323027 acd9850f1f21dd14be319c45fcdcffbffcf09fa8
child 323029 8c9c8720264d65050a97c6a9ba93b7914b96b8d5
push id9671
push userraliiev@mozilla.com
push dateMon, 06 Jun 2016 20:27:52 +0000
treeherdermozilla-aurora@cea65ca3d0bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1274242
milestone49.0a1
Bug 1274242 - Linkify should not stop at |. r=valentin
netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
netwerk/test/unit/test_mozTXTToHTMLConv.js
--- a/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
+++ b/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
@@ -303,17 +303,16 @@ mozTXTToHTMLConv::FindURLEnd(const char1
     bool seenOpeningParenthesis = false; // there is a '(' earlier in the URL
     bool seenOpeningSquareBracket = false; // there is a '[' earlier in the URL
     for (; int32_t(i) < aInStringLength; i++)
     {
       // These chars mark the end of the URL
       if (aInString[i] == '>' || aInString[i] == '<' ||
           aInString[i] == '"' || aInString[i] == '`' ||
           aInString[i] == '}' || aInString[i] == '{' ||
-          aInString[i] == '|' ||
           (aInString[i] == ')' && !seenOpeningParenthesis) ||
           (aInString[i] == ']' && !seenOpeningSquareBracket) ||
           // Allow IPv6 adresses like http://[1080::8:800:200C:417A]/foo.
           (aInString[i] == '[' && i > 2 &&
            (aInString[i - 1] != '/' || aInString[i - 2] != '/')) ||
           IsSpace(aInString[i]))
           break;
       // Disallow non-ascii-characters for email.
--- a/netwerk/test/unit/test_mozTXTToHTMLConv.js
+++ b/netwerk/test/unit/test_mozTXTToHTMLConv.js
@@ -105,16 +105,20 @@ function run_test() {
     },
     {
       input: "ipv6 2: http://[::ffff:127.0.0.1]/#yay test",
       url: "http://[::ffff:127.0.0.1]/#yay"
     },
     {
       input: "ipv6 parenthesis port: (http://[2001:db8::1]:80/) test",
       url: "http://[2001:db8::1]:80/"
+    },
+    {
+      input: "test http://www.map.com/map.php?t=Nova_Scotia&markers=//Not_a_survey||description=plm2 test",
+      url: "http://www.map.com/map.php?t=Nova_Scotia&amp;markers=//Not_a_survey||description=plm2"
     }
   ];
 
   const scanHTMLtests = [
     {
       input: "http://foo.example.com",
       shouldChange: true
     },