jenkins-bot has submitted this change and it was merged.

Change subject: Support IPv6 addresses in URLs
......................................................................


Support IPv6 addresses in URLs

Corresponding core patch is Iff077bf31168b431febb243e2e62f2c6502616bc.

Bug: T23261
Change-Id: Ibb33188cdfe2004e469c3f6ee6f30d34d1923283
---
M lib/pegTokenizer.pegjs.txt
M lib/wts.LinkHandler.js
M tests/parserTests-blacklist.js
M tests/parserTests.txt
4 files changed, 70 insertions(+), 49 deletions(-)

Approvals:
  Arlolra: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/pegTokenizer.pegjs.txt b/lib/pegTokenizer.pegjs.txt
index 065f477..767956e 100644
--- a/lib/pegTokenizer.pegjs.txt
+++ b/lib/pegTokenizer.pegjs.txt
@@ -398,12 +398,18 @@
   r:(
         "["
         & { return stops.push('extlink', true); }
-        target:extlink_preprocessor_text
+        addr:(url_protocol urladdr / "")
+        target:(extlink_preprocessor_text / "")
         & {
           // Protocol must be valid and there ought to be at least one
           // post-protocol character.  So strip last char off target
           // before testing protocol.
-          return Util.isProtocolValid(target.slice(0, -1), options.env);
+          var flat = tu.flattenString([addr, target]);
+          if (Array.isArray(flat)) {
+             // There are templates present, alas.
+             return flat.length > 0;
+          }
+          return Util.isProtocolValid(flat.slice(0, -1), options.env);
         }
         sp:$( space / unispace )*
         targetOff:( "" { return endOffset(); })
@@ -416,14 +422,9 @@
               )?
         "]" {
             stops.pop('extlink');
-            // if (text === '') {
-            //     // XXX: Link numbering should be implemented in 
post-processor.
-            //     text = [ "[" + linkCount + "]" ];
-            //     linkCount++;
-            // }
             return [
                 new SelfclosingTagTk('extlink', [
-                    new KV('href', target),
+                    new KV('href', tu.flattenString([addr, target])),
                     new KV('mw:content', content),
                     new KV('spaces', sp),
                 ], {
@@ -501,7 +502,7 @@
 // EXT_LINK_URL_CLASS which aren't included in no_punctuation_char
 url "url"
   = proto:url_protocol
-    addr:( ipv6_address / ipv4_address )?
+    addr:(urladdr / "")
     path:(  ( !{ return inlineBreaks(input, endOffset(), stops); } // 
inline_breaks
               c:no_punctuation_char
               { return c; }
@@ -516,10 +517,9 @@
                 ) { return r; }
          )*
          // Must be at least one character after the protocol
-         & { return addr !== null || path.length > 0; }
+         & { return addr.length > 0 || path.length > 0; }
 {
-    proto += addr || '';
-    return tu.flattenString([proto].concat(path));
+    return tu.flattenString([proto, addr].concat(path));
 }
 
 // this is the somewhat-restricted rule used in autolinks
@@ -534,7 +534,7 @@
     ! '//' // protocol-relative autolinks not allowed (T32269)
     r:(
     proto:url_protocol
-    addr:( ipv6_address / ipv4_address )?
+    addr:(urladdr / "")
     path:(  ( !{ return inlineBreaks(input, endOffset(), stops); } // 
inline_breaks
               ! "("
               c:no_punctuation_char
@@ -549,12 +549,11 @@
                     & "&" he:htmlentity { return he; }
                   / [&%{]
                 ) { return r; }
-         )+
+         )*
 {
     // as in Parser.php::makeFreeExternalLink, we're going to
     // yank trailing punctuation out of this match.
-    proto += addr || '';
-    var url = tu.flattenStringlist([proto].concat(path));
+    var url = tu.flattenStringlist([proto, addr].concat(path));
     // only need to look at last element; HTML entities are strip-proof.
     var last = url[url.length - 1];
     var trim = 0;
@@ -577,12 +576,12 @@
 } ) &{ return r !== null; } {return r; }
     / &{ return stops.pop('autourl'); }
 
-ipv4_address
-  = $([0-9]* '.' [0-9]* '.' [0-9]* '.' [0-9]*)
-
-ipv6_address
-  = $('[' [0-9]* ':' [0-9]* ':' [0-9]* ':' [0-9]* ':' [0-9]* ':' [0-9]* ':' 
[0-9]* ']')
-
+// This is extracted from EXT_LINK_ADDR in Parser.php: a simplified
+// expression to match an IPv6 address.  The IPv4 address and "at least
+// one character of a host name" portions are punted to the `path`
+// component of the `autourl` and `url` productions
+urladdr
+  = $( "[" [0-9A-Fa-f:.]+ "]" )
 
 /**************************************************************
  * Templates, -arguments and wikilinks
diff --git a/lib/wts.LinkHandler.js b/lib/wts.LinkHandler.js
index 89a471e..5bc1a99 100644
--- a/lib/wts.LinkHandler.js
+++ b/lib/wts.LinkHandler.js
@@ -241,7 +241,11 @@
        // this regexp is the negation of EXT_LINK_URL_CLASS in the PHP parser
        return 
url.replace(/[\]\[<>"\x00-\x20\x7F\u00A0\u1680\u180E\u2000-\u200A\u202F\u205F\u3000]/g,
 function(m) {
                return Util.entityEncodeAll(m);
-       });
+       }).replace(
+               // IPv6 host names are bracketed with [].  Entity-decode these.
+               /^([a-z][^:\/]*:)?\/\/&#x5B;([0-9a-f:.]+)&#x5D;(:\d|\/|$)/i,
+               '$1//[$2]$3'
+       );
 };
 
 var escapeLinkTarget = function(linkTarget, state) {
diff --git a/tests/parserTests-blacklist.js b/tests/parserTests-blacklist.js
index ae43f87..f145f3f 100644
--- a/tests/parserTests-blacklist.js
+++ b/tests/parserTests-blacklist.js
@@ -54,8 +54,6 @@
 add("wt2html", "Definition Lists: colons and tables 1", "<dl 
data-parsoid='{\"dsr\":[0,21,0,0]}'><dd 
data-parsoid='{\"dsr\":[0,10,1,0]}'><table 
data-parsoid='{\"dsr\":[1,10,2,2]}'>\n<tbody 
data-parsoid='{\"dsr\":[4,8,0,0]}'><tr 
data-parsoid='{\"autoInsertedEnd\":true,\"autoInsertedStart\":true,\"dsr\":[4,7,0,0]}'><td
 data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[4,7,1,0]}'> 
x</td></tr>\n</tbody></table></dd>\n<dd 
data-parsoid='{\"dsr\":[11,21,1,0]}'><table 
data-parsoid='{\"dsr\":[12,21,2,2]}'>\n<tbody 
data-parsoid='{\"dsr\":[15,19,0,0]}'><tr 
data-parsoid='{\"autoInsertedEnd\":true,\"autoInsertedStart\":true,\"dsr\":[15,18,0,0]}'><td
 data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[15,18,1,0]}'> 
y</td></tr>\n</tbody></table></dd></dl>");
 add("wt2html", "Bug 2702: Mismatched <i>, <b> and <a> tags are invalid", "<p 
data-parsoid='{\"dsr\":[0,204,0,0]}'><i 
data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[0,29,2,0]}'><a 
rel=\"mw:ExtLink\" href=\"http://example.com\"; 
data-parsoid='{\"targetOff\":22,\"contentOffsets\":[22,28],\"dsr\":[2,29,20,1]}'>text<i
 data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[26,28,2,0]}'></i></a></i>\n<a 
rel=\"mw:ExtLink\" href=\"http://example.com\"; 
data-parsoid='{\"targetOff\":50,\"contentOffsets\":[50,57],\"dsr\":[30,58,20,1]}'><b
 data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[50,57,3,0]}'>text</b></a><b 
data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[58,61,3,0]}'></b>\n<i 
data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[62,106,2,0]}'>Something <a 
rel=\"mw:ExtLink\" href=\"http://example.com\"; 
data-parsoid='{\"targetOff\":94,\"contentOffsets\":[94,105],\"dsr\":[74,106,20,1]}'>in
 italic<i 
data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[103,105,2,0]}'></i></a></i>\n<i
 data-parsoid='{\"dsr\":[107,164,2,2]}'>Something <a rel=\"mw:ExtLink\" 
href=\"http://example.com\"; 
data-parsoid='{\"targetOff\":139,\"contentOffsets\":[139,160],\"dsr\":[119,161,20,1]}'>mixed<b
 data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[144,160,3,0]}'><i 
data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[147,160,2,0]}'>, even 
bold</i></b></a>'</i>\n<b 
data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[165,204,3,0]}'><i 
data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[168,204,2,0]}'>Now <a 
rel=\"mw:ExtLink\" href=\"http://example.com\"; 
data-parsoid='{\"targetOff\":194,\"contentOffsets\":[194,203],\"dsr\":[174,204,20,1]}'>both<b
 data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[198,203,3,0]}'><i 
data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[201,203,2,0]}'></i></b></a></i></b></p>");
 add("wt2html", "External link containing double-single-quotes in text embedded 
in italics (bug 4598 sanity check)", "<p data-parsoid='{\"dsr\":[0,60,0,0]}'><i 
data-parsoid='{\"dsr\":[0,60,2,2]}'>Some <a rel=\"mw:ExtLink\" 
href=\"http://example.com/\"; 
data-parsoid='{\"targetOff\":28,\"contentOffsets\":[28,56],\"dsr\":[7,57,21,1]}'>pretty
 <i data-parsoid='{\"dsr\":[35,46,2,2]}'>italics</i> and stuff</a>!</i></p>");
-add("wt2html", "IPv6 urls, autolink format (T23261)", "<p 
data-parsoid='{\"dsr\":[0,41,0,0]}'><a rel=\"mw:ExtLink\" 
href=\"http://[2404:130:0:1000::187:2]/index.php\"; 
data-parsoid='{\"stx\":\"url\",\"dsr\":[0,41,0,0]}'>http://[2404:130:0:1000::187:2]/index.php</a></p>\n\n<p
 data-parsoid='{\"dsr\":[43,78,0,0]}'>Examples from RFC2373, section 
2.2:</p>\n<ul data-parsoid='{\"dsr\":[79,277,0,0]}'><li 
data-parsoid='{\"dsr\":[79,119,1,0]}'> 
http://[1080::8:800:200C:417A]/unicast</li>\n<li 
data-parsoid='{\"dsr\":[120,150,1,0]}'> http://[FF01::101]/multicast</li>\n<li 
data-parsoid='{\"dsr\":[151,174,1,0]}'> http://[::1]/loopback</li>\n<li 
data-parsoid='{\"dsr\":[175,200,1,0]}'> http://[::]/unspecified</li>\n<li 
data-parsoid='{\"dsr\":[201,234,1,0]}'> 
http://[::13.1.68.3]/ipv4compat</li>\n<li 
data-parsoid='{\"dsr\":[235,277,1,0]}'> 
http://[::FFFF:129.144.52.38]/ipv4compat</li></ul>\n\n<p 
data-parsoid='{\"dsr\":[279,313,0,0]}'>Examples from <a 
href=\"//tools.ietf.org/html/rfc2732\" rel=\"mw:ExtLink\" 
data-parsoid='{\"stx\":\"magiclink\",\"dsr\":[293,301,0,0]}'>RFC 2732</a>, 
section 2:</p>\n<ul data-parsoid='{\"dsr\":[314,608,0,0]}'><li 
data-parsoid='{\"dsr\":[314,378,1,0]}'> 
http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html</li>\n<li 
data-parsoid='{\"dsr\":[379,427,1,0]}'> 
http://[1080:0:0:0:8:800:200C:417A]/index.html</li>\n<li 
data-parsoid='{\"dsr\":[428,460,1,0]}'> 
http://[3ffe:2a00:100:7031::1]</li>\n<li 
data-parsoid='{\"dsr\":[461,497,1,0]}'> 
http://[1080::8:800:200C:417A]/foo</li>\n<li 
data-parsoid='{\"dsr\":[498,525,1,0]}'> http://[::192.9.5.5]/ipng</li>\n<li 
data-parsoid='{\"dsr\":[526,571,1,0]}'> 
http://[::FFFF:129.144.52.38]:80/index.html</li>\n<li 
data-parsoid='{\"dsr\":[572,608,1,0]}'> 
http://[2010:836B:4179::836B:4179]</li></ul>\n");
-add("wt2html", "IPv6 urls, bracketed format (T23261)", "<p 
data-parsoid='{\"dsr\":[0,48,0,0]}'>[<a rel=\"mw:ExtLink\" 
href=\"http://[2404:130:0:1000::187:2]/index.php\"; 
data-parsoid='{\"stx\":\"url\",\"dsr\":[1,42,0,0]}'>http://[2404:130:0:1000::187:2]/index.php</a>
 test]</p>\n\n<p data-parsoid='{\"dsr\":[50,85,0,0]}'>Examples from RFC2373, 
section 2.2:</p>\n<ul data-parsoid='{\"dsr\":[86,297,0,0]}'><li 
data-parsoid='{\"dsr\":[86,128,1,0]}'> [http://[1080::8:800:200C:417A] 
unicast]</li>\n<li data-parsoid='{\"dsr\":[129,161,1,0]}'> [http://[FF01::101] 
multicast]</li>\n<li data-parsoid='{\"dsr\":[162,188,1,0]}'> [http://[::1]/ 
loopback]</li>\n<li data-parsoid='{\"dsr\":[189,216,1,0]}'> [http://[::] 
unspecified]</li>\n<li data-parsoid='{\"dsr\":[217,252,1,0]}'> 
[http://[::13.1.68.3] ipv4compat]</li>\n<li 
data-parsoid='{\"dsr\":[253,297,1,0]}'> [http://[::FFFF:129.144.52.38] 
ipv4compat]</li></ul>\n\n<p data-parsoid='{\"dsr\":[299,333,0,0]}'>Examples 
from <a href=\"//tools.ietf.org/html/rfc2732\" rel=\"mw:ExtLink\" 
data-parsoid='{\"stx\":\"magiclink\",\"dsr\":[313,321,0,0]}'>RFC 2732</a>, 
section 2:</p>\n<ul data-parsoid='{\"dsr\":[334,656,0,0]}'><li 
data-parsoid='{\"dsr\":[334,402,1,0]}'> 
[http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html 1]</li>\n<li 
data-parsoid='{\"dsr\":[403,455,1,0]}'> 
[http://[1080:0:0:0:8:800:200C:417A]/index.html 2]</li>\n<li 
data-parsoid='{\"dsr\":[456,492,1,0]}'> [http://[3ffe:2a00:100:7031::1] 
3]</li>\n<li data-parsoid='{\"dsr\":[493,533,1,0]}'> 
[http://[1080::8:800:200C:417A]/foo 4]</li>\n<li 
data-parsoid='{\"dsr\":[534,565,1,0]}'> [http://[::192.9.5.5]/ipng 5]</li>\n<li 
data-parsoid='{\"dsr\":[566,615,1,0]}'> 
[http://[::FFFF:129.144.52.38]:80/index.html 6]</li>\n<li 
data-parsoid='{\"dsr\":[616,656,1,0]}'> [http://[2010:836B:4179::836B:4179] 
7]</li></ul>\n");
 add("wt2html", "Self-link to numeric title", "<p 
data-parsoid='{\"dsr\":[0,5,0,0]}'><a rel=\"mw:WikiLink\" href=\"./0\" 
title=\"0\" 
data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./0\"},\"sa\":{\"href\":\"0\"},\"dsr\":[0,5,2,2]}'>0</a></p>");
 add("wt2html", "<nowiki> inside a link", "<p 
data-parsoid='{\"dsr\":[0,96,0,0]}'><a rel=\"mw:WikiLink\" href=\"./Main_Page\" 
title=\"Main Page\" 
data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Main_Page\"},\"sa\":{\"href\":\"Main&lt;nowiki>
 Page&lt;/nowiki>\"},\"dsr\":[0,30,2,2]}'>Main Page</a> <a rel=\"mw:WikiLink\" 
href=\"./Main_Page\" title=\"Main Page\" 
data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Main_Page\"},\"sa\":{\"href\":\"Main
 Page\"},\"dsr\":[31,96,12,2]}'>the main page <span typeof=\"mw:Nowiki\" 
data-parsoid='{\"dsr\":[57,94,8,9]}'>[it's not very good]</span></a></p>");
 add("wt2html", "Interlanguage link with spacing", "<p 
data-parsoid='{\"dsr\":[0,14,0,0]}'>Blah blah blah</p>\n<link 
rel=\"mw:PageProp/Language\" href=\"http://zh.wikipedia.org/wiki/    Chinese    
 \" 
data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"http://zh.wikipedia.org/wiki/
    Chinese     \"},\"sa\":{\"href\":\"   zh  :    Chinese     
\"},\"dsr\":[15,43,null,null]}'/>");
@@ -334,8 +332,6 @@
 add("wt2wt", "External links: wiki links within external link (Bug 3695)", 
"[http://example.com][[wikilink]] embedded in ext link\n");
 add("wt2wt", "Bug 2702: Mismatched <i>, <b> and <a> tags are invalid", 
"''[http://example.com text''<nowiki/>'']''\n[http://example.com 
'''text''']'''<nowiki/>'''\n''Something [http://example.com in 
italic''<nowiki/>'']''\n''Something [http://example.com mixed''''', even 
bold''''']'''\n'''''Now [http://example.com both'''''<nowiki/>''''']'''''\n");
 add("wt2wt", "External link containing double-single-quotes with no space 
separating the url from text in italics", 
"[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm ''La muerte de 
Casagemas'' (1901) en el sitio de ][[Museo Picasso (París)|Museo Picasso]].\n");
-add("wt2wt", "IPv6 urls, autolink format (T23261)", 
"http://&#x5B;2404:130:0:1000::187:2&#x5D;/index.php\n\nExamples from RFC2373, 
section 2.2:\n* http://[1080::8:800:200C:417A]/unicast\n* 
http://[FF01::101]/multicast\n* http://[::1]/loopback\n* 
http://[::]/unspecified\n* http://[::13.1.68.3]/ipv4compat\n* 
http://[::FFFF:129.144.52.38]/ipv4compat\n\nExamples from RFC 2732, section 
2:\n* http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html\n* 
http://[1080:0:0:0:8:800:200C:417A]/index.html\n* 
http://[3ffe:2a00:100:7031::1]\n* http://[1080::8:800:200C:417A]/foo\n* 
http://[::192.9.5.5]/ipng\n* http://[::FFFF:129.144.52.38]:80/index.html\n* 
http://[2010:836B:4179::836B:4179]\n";);
-add("wt2wt", "IPv6 urls, bracketed format (T23261)", 
"[http://&#x5B;2404:130:0:1000::187:2&#x5D;/index.php test]\n\nExamples from 
RFC2373, section 2.2:\n* [http://[1080::8:800:200C:417A] unicast]\n* 
[http://[FF01::101] multicast]\n* [http://[::1]/ loopback]\n* [http://[::] 
unspecified]\n* [http://[::13.1.68.3] ipv4compat]\n* 
[http://[::FFFF:129.144.52.38] ipv4compat]\n\nExamples from RFC 2732, section 
2:\n* [http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html 1]\n* 
[http://[1080:0:0:0:8:800:200C:417A]/index.html 2]\n* 
[http://[3ffe:2a00:100:7031::1] 3]\n* [http://[1080::8:800:200C:417A]/foo 4]\n* 
[http://[::192.9.5.5]/ipng 5]\n* [http://[::FFFF:129.144.52.38]:80/index.html 
6]\n* [http://[2010:836B:4179::836B:4179] 7]\n");
 add("wt2wt", "Unclosed and unmatched quotes", "'''''Bold italic text '''with 
bold deactivated''' in between.'''''\n\n'''''Bold italic text ''with italic 
deactivated'' in between.'''''\n\n'''Bold text..'''\n\n..spanning two 
paragraphs (should not work).'''<nowiki/>'''\n\n'''Bold tag left 
open'''\n\n''Italic tag left open''\n\nNormal text.\n\n<!-- Unmatching number 
of opening, closing tags: -->\n'''This year'<nowiki/>'''s election ''should'' 
beat '''last year''''s.\n\n''Tom'''s car is bigger than 
'''''<nowiki/>'''Susan'''s.\n\nPlain ''italic'''s plain\n");
 add("wt2wt", "A table with captions with non-default spaced attributes and a 
table row", "{|\n|+ style=\"color: red;\" |caption2\n|+ style=\"color: red;\" | 
caption3\n|-\n| foo\n|}");
 add("wt2wt", "Table td-cell syntax variations", "{|\n| foo bar | baz\n| foo 
bar foo || baz\n| style=\"color:red;\" | baz\n| style='color:red;' || baz\n|}");
@@ -455,7 +451,6 @@
 add("html2html", "Definition lists: colon in HTML attribute", "<dl 
data-parsoid='{\"dsr\":[0,12,0,0]}'><dt data-parsoid='{\"dsr\":[0,12,1,0]}'> <b 
data-parsoid='{\"dsr\":[2,12,3,3]}'>bold</b></dt></dl>\n");
 add("html2html", "Definition Lists: Nesting: Multi-level (Parsoid only)", 
"\n<dl data-parsoid='{\"dsr\":[1,116,0,0]}'><dt 
data-parsoid='{\"dsr\":[1,6,1,0]}'> t1 </dt>\n<dd 
data-parsoid='{\"dsr\":[7,17,1,0]}'> d1      </dd>\n<dt 
data-parsoid='{\"dsr\":[18,116,1,0]}'><dl 
data-parsoid='{\"dsr\":[19,116,0,0]}'><dt data-parsoid='{\"dsr\":[19,24,1,0]}'> 
t2 </dt>\n<dd data-parsoid='{\"dsr\":[25,62,2,0]}'> <span typeof=\"mw:Nowiki\" 
data-parsoid='{\"dsr\":[28,48,8,9]}'>:d2</span>              </dd>\n<dt 
data-parsoid='{\"dsr\":[63,116,2,0]}'><dl 
data-parsoid='{\"dsr\":[65,116,0,0]}'><dt data-parsoid='{\"dsr\":[65,70,1,0]}'> 
t3 </dt>\n<dd data-parsoid='{\"dsr\":[71,116,3,0]}'> <span typeof=\"mw:Nowiki\" 
data-parsoid='{\"dsr\":[75,96,8,9]}'>::d3</span>                    
</dd></dl></dt></dl></dt></dl>\n");
 add("html2html", "Definition Lists: colons and tables 1", "<dl 
data-parsoid='{\"dsr\":[0,26,0,0]}'><dd data-parsoid='{\"dsr\":[0,12,1,0]}'> 
<table data-parsoid='{\"dsr\":[2,12,2,2]}'>\n\n<tbody 
data-parsoid='{\"dsr\":[6,10,0,0]}'><tr 
data-parsoid='{\"autoInsertedEnd\":true,\"autoInsertedStart\":true,\"dsr\":[6,9,0,0]}'><td
 data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[6,9,1,0]}'> 
x</td></tr>\n</tbody></table></dd>\n\n<dd data-parsoid='{\"dsr\":[14,26,1,0]}'> 
<table data-parsoid='{\"dsr\":[16,26,2,2]}'>\n\n<tbody 
data-parsoid='{\"dsr\":[20,24,0,0]}'><tr 
data-parsoid='{\"autoInsertedEnd\":true,\"autoInsertedStart\":true,\"dsr\":[20,23,0,0]}'><td
 data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[20,23,1,0]}'> 
y</td></tr>\n</tbody></table></dd></dl>\n");
-add("html2html", "IPv6 urls, bracketed format (T23261)", "<p 
data-parsoid='{\"dsr\":[0,58,0,0]}'><a rel=\"mw:ExtLink\" 
href=\"http://[2404:130:0:1000::187:2]/index.php\"; 
data-parsoid='{\"targetOff\":53,\"contentOffsets\":[53,57],\"a\":{\"href\":\"http://[2404:130:0:1000::187:2]/index.php\"},\"sa\":{\"href\":\"http://&amp;#x5B;2404:130:0:1000::187:2&amp;#x5D;/index.php\"},\"dsr\":[0,58,53,1]}'>test</a></p>\n\n<p
 data-parsoid='{\"dsr\":[60,95,0,0]}'>Examples from RFC2373, section 
2.2:</p>\n\n<ul data-parsoid='{\"dsr\":[97,368,0,0]}'><li 
data-parsoid='{\"dsr\":[97,149,1,0]}'> [http://<span typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5B;\",\"srcContent\":\"[\",\"dsr\":[107,113,null,null]}'>[</span>1080::8:800:200C:417A<span
 typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5D;\",\"srcContent\":\"]\",\"dsr\":[134,140,null,null]}'>]</span>
 unicast]</li>\n<li data-parsoid='{\"dsr\":[150,192,1,0]}'> [http://<span 
typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5B;\",\"srcContent\":\"[\",\"dsr\":[160,166,null,null]}'>[</span>FF01::101<span
 typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5D;\",\"srcContent\":\"]\",\"dsr\":[175,181,null,null]}'>]</span>
 multicast]</li>\n<li data-parsoid='{\"dsr\":[193,229,1,0]}'> [http://<span 
typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5B;\",\"srcContent\":\"[\",\"dsr\":[203,209,null,null]}'>[</span>::1<span
 typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5D;\",\"srcContent\":\"]\",\"dsr\":[212,218,null,null]}'>]</span>/
 loopback]</li>\n<li data-parsoid='{\"dsr\":[230,267,1,0]}'> [http://<span 
typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5B;\",\"srcContent\":\"[\",\"dsr\":[240,246,null,null]}'>[</span>::<span
 typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5D;\",\"srcContent\":\"]\",\"dsr\":[248,254,null,null]}'>]</span>
 unspecified]</li>\n<li data-parsoid='{\"dsr\":[268,313,1,0]}'> [http://<span 
typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5B;\",\"srcContent\":\"[\",\"dsr\":[278,284,null,null]}'>[</span>::13.1.68.3<span
 typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5D;\",\"srcContent\":\"]\",\"dsr\":[295,301,null,null]}'>]</span>
 ipv4compat]</li>\n<li data-parsoid='{\"dsr\":[314,368,1,0]}'> [http://<span 
typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5B;\",\"srcContent\":\"[\",\"dsr\":[324,330,null,null]}'>[</span>::FFFF:129.144.52.38<span
 typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5D;\",\"srcContent\":\"]\",\"dsr\":[350,356,null,null]}'>]</span>
 ipv4compat]</li></ul>\n<p data-parsoid='{\"dsr\":[369,403,0,0]}'>Examples from 
<a href=\"//tools.ietf.org/html/rfc2732\" rel=\"mw:ExtLink\" 
data-parsoid='{\"stx\":\"magiclink\",\"dsr\":[383,391,0,0]}'>RFC 2732</a>, 
section 2:</p>\n\n<ul data-parsoid='{\"dsr\":[405,797,0,0]}'><li 
data-parsoid='{\"dsr\":[405,483,1,0]}'> [http://<span typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5B;\",\"srcContent\":\"[\",\"dsr\":[415,421,null,null]}'>[</span>FEDC:BA98:7654:3210:FEDC:BA98:7654:3210<span
 typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5D;\",\"srcContent\":\"]\",\"dsr\":[460,466,null,null]}'>]</span>:80/index.html
 1]</li>\n<li data-parsoid='{\"dsr\":[484,546,1,0]}'> [http://<span 
typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5B;\",\"srcContent\":\"[\",\"dsr\":[494,500,null,null]}'>[</span>1080:0:0:0:8:800:200C:417A<span
 typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5D;\",\"srcContent\":\"]\",\"dsr\":[526,532,null,null]}'>]</span>/index.html
 2]</li>\n<li data-parsoid='{\"dsr\":[547,593,1,0]}'> [http://<span 
typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5B;\",\"srcContent\":\"[\",\"dsr\":[557,563,null,null]}'>[</span>3ffe:2a00:100:7031::1<span
 typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5D;\",\"srcContent\":\"]\",\"dsr\":[584,590,null,null]}'>]</span>
 3]</li>\n<li data-parsoid='{\"dsr\":[594,644,1,0]}'> [http://<span 
typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5B;\",\"srcContent\":\"[\",\"dsr\":[604,610,null,null]}'>[</span>1080::8:800:200C:417A<span
 typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5D;\",\"srcContent\":\"]\",\"dsr\":[631,637,null,null]}'>]</span>/foo
 4]</li>\n<li data-parsoid='{\"dsr\":[645,686,1,0]}'> [http://<span 
typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5B;\",\"srcContent\":\"[\",\"dsr\":[655,661,null,null]}'>[</span>::192.9.5.5<span
 typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5D;\",\"srcContent\":\"]\",\"dsr\":[672,678,null,null]}'>]</span>/ipng
 5]</li>\n<li data-parsoid='{\"dsr\":[687,746,1,0]}'> [http://<span 
typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5B;\",\"srcContent\":\"[\",\"dsr\":[697,703,null,null]}'>[</span>::FFFF:129.144.52.38<span
 typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5D;\",\"srcContent\":\"]\",\"dsr\":[723,729,null,null]}'>]</span>:80/index.html
 6]</li>\n<li data-parsoid='{\"dsr\":[747,797,1,0]}'> [http://<span 
typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5B;\",\"srcContent\":\"[\",\"dsr\":[757,763,null,null]}'>[</span>2010:836B:4179::836B:4179<span
 typeof=\"mw:Entity\" 
data-parsoid='{\"src\":\"&amp;#x5D;\",\"srcContent\":\"]\",\"dsr\":[788,794,null,null]}'>]</span>
 7]</li></ul>\n");
 add("html2html", "Indented table markup mixed with indented pre content 
(proposed in bug 6200)", " <table 
data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[1,58,2,0]}'>\n \n <tbody 
data-parsoid='{\"dsr\":[7,58,0,0]}'><tr 
data-parsoid='{\"autoInsertedEnd\":true,\"autoInsertedStart\":true,\"dsr\":[7,58,0,0]}'><td
 data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[7,58,1,0]}'>\n<pre 
data-parsoid='{\"dsr\":[9,58,1,0]}'>Text that should be rendered preformatted 
\n\n|}</pre></td></tr></tbody></table>\n");
 add("html2html", "Build table with wikilink", "<table class=\"wikitable\" 
data-parsoid='{\"dsr\":[0,216,20,2]}'>\n\n<tbody 
data-parsoid='{\"dsr\":[22,214,0,0]}'><tr 
data-parsoid='{\"autoInsertedEnd\":true,\"autoInsertedStart\":true,\"dsr\":[22,47,0,0]}'><th
 data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[22,31,1,0]}'> header 
</th>\n<th data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[32,47,1,0]}'> 
second header</th></tr>\n\n<tr style=\"color:red;\" 
data-parsoid='{\"startTagSrc\":\"|-\",\"autoInsertedEnd\":true,\"dsr\":[49,148,21,0]}'>\n<td
 data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[71,106,1,0]}'> data <a 
rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" 
data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main
 Page\"},\"dsr\":[78,105,17,2]}'>linktext</a> </td>\n<td 
data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[107,148,1,0]}'> second data <a 
rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" 
data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main
 Page\"},\"dsr\":[121,148,17,2]}'>linktext</a></td></tr>\n\n<tr 
data-parsoid='{\"startTagSrc\":\"|-\",\"autoInsertedEnd\":true,\"dsr\":[150,213,2,0]}'>\n<td
 data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[153,160,1,0]}'> data 
</td>\n<td data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[161,213,1,0]}'> 
second data <a rel=\"mw:WikiLink\" href=\"./Wiki/Main_Page\" title=\"Wiki/Main 
Page\" 
data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main
 Page\"},\"dsr\":[175,213,17,2]}'>link|text with 
pipe</a></td></tr>\n</tbody></table>\n");
 add("html2html", "Plain link, capitalized", "<p 
data-parsoid='{\"dsr\":[0,28,0,0]}'><a rel=\"mw:WikiLink\" 
href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" 
data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main
 Page\"},\"dsr\":[0,28,17,2]}'>Main Page</a></p>\n");
@@ -814,8 +809,6 @@
 add("html2wt", "External link containing double-single-quotes with no space 
separating the url from text in italics", 
"[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm ''La muerte de 
Casagemas'' (1901) en el sitio de ][[Museo Picasso (París)|Museo 
Picasso]]<span>.</span>\n");
 add("html2wt", "URL-encoding in URL functions (single parameter)", 
"/index.php?title=Some_page&amp=&\n");
 add("html2wt", "URL-encoding in URL functions (multiple parameters)", 
"/index.php?title=Some_page&q=?&amp=&\n");
-add("html2wt", "IPv6 urls, autolink format (T23261)", 
"http://&#x5B;2404:130:0:1000::187:2&#x5D;/index.php\n\nExamples from RFC2373, 
section 2.2:\n\n* http://&#x5B;1080::8:800:200C:417A&#x5D;/unicast\n* 
http://&#x5B;FF01::101&#x5D;/multicast\n* http://&#x5B;::1&#x5D;/loopback\n* 
http://&#x5B;::&#x5D;/unspecified\n* 
http://&#x5B;::13.1.68.3&#x5D;/ipv4compat\n* 
http://&#x5B;::FFFF:129.144.52.38&#x5D;/ipv4compat\nExamples from RFC 2732, 
section 2:\n\n* 
http://&#x5B;FEDC:BA98:7654:3210:FEDC:BA98:7654:3210&#x5D;:80/index.html\n* 
http://&#x5B;1080:0:0:0:8:800:200C:417A&#x5D;/index.html\n* 
http://&#x5B;3ffe:2a00:100:7031::1&#x5D;\n* 
http://&#x5B;1080::8:800:200C:417A&#x5D;/foo\n* 
http://&#x5B;::192.9.5.5&#x5D;/ipng\n* 
http://&#x5B;::FFFF:129.144.52.38&#x5D;:80/index.html\n* 
http://&#x5B;2010:836B:4179::836B:4179&#x5D;\n";);
-add("html2wt", "IPv6 urls, bracketed format (T23261)", 
"[http://&#x5B;2404:130:0:1000::187:2&#x5D;/index.php test]\n\nExamples from 
RFC2373, section 2.2:\n\n* [http://&#x5B;1080::8:800:200C:417A&#x5D; 
unicast]\n* [http://&#x5B;FF01::101&#x5D; multicast]\n* 
[http://&#x5B;::1&#x5D;/ loopback]\n* [http://&#x5B;::&#x5D; unspecified]\n* 
[http://&#x5B;::13.1.68.3&#x5D; ipv4compat]\n* 
[http://&#x5B;::FFFF:129.144.52.38&#x5D; ipv4compat]\nExamples from RFC 2732, 
section 2:\n\n* 
[http://&#x5B;FEDC:BA98:7654:3210:FEDC:BA98:7654:3210&#x5D;:80/index.html 1]\n* 
[http://&#x5B;1080:0:0:0:8:800:200C:417A&#x5D;/index.html 2]\n* 
[http://&#x5B;3ffe:2a00:100:7031::1&#x5D; 3]\n* 
[http://&#x5B;1080::8:800:200C:417A&#x5D;/foo 4]\n* 
[http://&#x5B;::192.9.5.5&#x5D;/ipng 5]\n* 
[http://&#x5B;::FFFF:129.144.52.38&#x5D;:80/index.html 6]\n* 
[http://&#x5B;2010:836B:4179::836B:4179&#x5D; 7]\n");
 add("html2wt", "Non-extlinks in brackets", "[foo]\n[foo bar]\n[foo 
''bar'']\n[fool's] errand\n[fool's errand]\n[foo]\n[foo bar]\n[foo 
''bar'']\n[fool's] errand\n[fool's 
errand]\n[url=foo]\n[url=http://example.com]\n[http:// bare protocols don't 
count]\n");
 add("html2wt", "Unclosed and unmatched quotes", "'''''Bold italic text '''with 
bold deactivated''' in between.'''''\n\n'''''Bold italic text ''with italic 
deactivated'' in between.'''''\n\n'''Bold text..'''\n\n..spanning two 
paragraphs (should not work).'''<nowiki/>'''\n\n'''Bold tag left 
open'''\n\n''Italic tag left open''\n\nNormal text.\n\n<!-- Unmatching number 
of opening, closing tags: -->\n'''This year'<nowiki/>'''s election ''should'' 
beat '''last year''''s.\n\n''Tom'''s car is bigger than 
'''''<nowiki/>'''Susan'''s.\n\nPlain ''italic'''s plain\n");
 add("html2wt", "A table with caption with default-spaced attributes and a 
table row", "{|\n|+ style=\"color: red;\" | caption1\n\n| foo\n|}\n");
@@ -1584,19 +1577,6 @@
 add("selser", "External link containing double-single-quotes with no space 
separating the url from text in italics [[1,3,0]]", 
"[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm ''La muerte de 
Casagemas'' (1901) en el sitio de ]\n");
 add("selser", "External link containing double-single-quotes with no space 
separating the url from text in italics [[4,0,3]]", "s7cmk1ocalpd5cdi\n");
 add("selser", "External link containing double-single-quotes with no space 
separating the url from text in italics [[[1,2],2,4]]", 
"[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm ''La muerte de 
Casagemas''wvn1dm0gv694fgvi (1901) en el sitio de 
]bizwk64e6yfogvi3d9bhvaaeq8jv2t9");
-add("selser", "IPv6 urls, autolink format (T23261) [[2],0,[4],0,4,0,1,0,2,0]", 
"45jgm4n0yy4on7b9<nowiki/>http://[2404:130:0:1000::187:2]/index.php\n\n96i1s1m2dod8ia4i\n\nxvytxg6w00wqxgvi\n\nExamples
 from RFC 2732, section 2:\n\nfsrqvr6zu84cxr\n* 
http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html\n* 
http://[1080:0:0:0:8:800:200C:417A]/index.html\n* 
http://[3ffe:2a00:100:7031::1]\n* http://[1080::8:800:200C:417A]/foo\n* 
http://[::192.9.5.5]/ipng\n* http://[::FFFF:129.144.52.38]:80/index.html\n* 
http://[2010:836B:4179::836B:4179]\n";);
-add("selser", "IPv6 urls, autolink format (T23261) [2,4,3,0,2,3,4,2,1,0]", 
"uv5xktt94eku766r\n\nhttp://[2404:130:0:1000::187:2]/index.php\n\ne72h7o0er4rkke29\n\njprjv514552sxlxr\n*
 http://[1080::8:800:200C:417A]/unicast\n* http://[FF01::101]/multicast\n* 
http://[::1]/loopback\n* http://[::]/unspecified\n* 
http://[::13.1.68.3]/ipv4compat\n* 
http://[::FFFF:129.144.52.38]/ipv4compat\nyjujeffzl3r0y66r\n\np41sbl65sgzxgvi\n*
 http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html\n* 
http://[1080:0:0:0:8:800:200C:417A]/index.html\n* 
http://[3ffe:2a00:100:7031::1]\n* http://[1080::8:800:200C:417A]/foo\n* 
http://[::192.9.5.5]/ipng\n* http://[::FFFF:129.144.52.38]:80/index.html\n* 
http://[2010:836B:4179::836B:4179]\n";);
-add("selser", "IPv6 urls, autolink format (T23261) [2,0,2,0,1,3,3,2,3,3]", 
"tg36q6uuatcvj9k9\n\nhttp://[2404:130:0:1000::187:2]/index.php\n\n95wvynqcn89f6r\n\nExamples
 from RFC2373, section 2.2:\n* http://[1080::8:800:200C:417A]/unicast\n* 
http://[FF01::101]/multicast\n* http://[::1]/loopback\n* 
http://[::]/unspecified\n* http://[::13.1.68.3]/ipv4compat\n* 
http://[::FFFF:129.144.52.38]/ipv4compat\nzpcaqsgb2gj8m2t9\n";);
-add("selser", "IPv6 urls, autolink format (T23261) 
[0,2,[2],0,2,4,1,4,[0,4,1,0,1,2,3,4,[4],0,4,0,0],3]", 
"http://[2404:130:0:1000::187:2]/index.php\n\n2e6c9qy0l3m1jor\n\n1hm16gmimvbtvs4iExamples
 from RFC2373, section 2.2:\n\ncs5tzf2ji8yhw7b9\n* 
http://[1080::8:800:200C:417A]/unicast\n* http://[FF01::101]/multicast\n* 
http://[::1]/loopback\n* http://[::]/unspecified\n* 
http://[::13.1.68.3]/ipv4compat\n* 
http://[::FFFF:129.144.52.38]/ipv4compat\nasso6pf3zn5yu8fr\n\nExamples from RFC 
2732, section 2:\n\n84y5hqhfov42t9\n* 
http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html\n* 
yd96c94gwj73z0k9\n* http://[1080:0:0:0:8:800:200C:417A]/index.html\n* 
http://[3ffe:2a00:100:7031::1]\n* 5lqpjf9squth85mi\n* 
u8ea4l7i6u56zuxr\n*3pf3bmp3bkervn29\n* 4m87ahilxdnghkt9\n* 
http://[2010:836B:4179::836B:4179]\n";);
-add("selser", "IPv6 urls, autolink format (T23261) 
[1,0,3,0,[2,0,[4],0,4,0,[4],0,[3],0,0],0,1,0,[[3],0,3,4,[3],0,4,0,[4],0,1,3,0],3]",
 "http://[2404:130:0:1000::187:2]/index.php\n\n* 1xlw89h6txd2t9\n* 
http://[1080::8:800:200C:417A]/unicast\n*cqufukswkp1d1jor\n* 
vmqzz1cbftsdobt9\n*zy15lpor0j7zaor\n*\n* 
http://[::FFFF:129.144.52.38]/ipv4compat\n\nExamples from RFC 2732, section 
2:\n*\n* 7gbanjusqfv9rudi\n*\n* yyoa16vwvzd26gvi\n*gmq92kwvew89f6r\n* 
http://[::FFFF:129.144.52.38]:80/index.html\n* 
http://[2010:836B:4179::836B:4179]";);
-add("selser", "IPv6 urls, autolink format (T23261) 
[[2],0,1,0,3,3,2,4,[4,0,0,3,4,0,3,0,0,0,0,3,2],0]", 
"5wfwxl6fl9q0vn29<nowiki/>http://[2404:130:0:1000::187:2]/index.php\n\nExamples 
from RFC2373, section 2.2:\n\nwgtqsgg5d5sqyqfr\n\nExamples from RFC 2732, 
section 2:\n\navtuoiq1794tpgb9\n* 50nmxf1m0w0l766r\n* 
http://[1080:0:0:0:8:800:200C:417A]/index.html\n* u1ftbujihl8wu3di\n* 
http://[::192.9.5.5]/ipng\n* http://[::FFFF:129.144.52.38]:80/index.html\n* 
mptfckjbzi553ik9\n* http://[2010:836B:4179::836B:4179]\n";);
-add("selser", "IPv6 urls, bracketed format (T23261) 
[2,0,2,0,[1,2,1,0,[3],0,0,0,0,0,1],0,0,0,[1,2,0,0,1,0,[4],3,2,0,0,0,1],4]", 
"w4qfalupnykz9f6r\n\n[http://[2404:130:0:1000::187:2]/index.php 
test]\n\naka3hmsildefusor\n\nExamples from RFC2373, section 2.2:\n* 
[http://[1080::8:800:200C:417A] unicast]\n* zwi9rd7kt5z2rzfr\n* 
[http://[FF01::101] multicast]\n*\n* [http://[::] unspecified]\n* 
[http://[::13.1.68.3] ipv4compat]\n* [http://[::FFFF:129.144.52.38] 
ipv4compat]\n\nExamples from RFC 2732, section 2:\n* 
[http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html 1]\n* 
b6ff4fuwdas5g66r\n* [http://[1080:0:0:0:8:800:200C:417A]/index.html 2]\n* 
[http://[3ffe:2a00:100:7031::1] 3]\n*qz7gfu2fdtbxd2t9\n* qadtnq6padhx5hfr\n* 
[http://[::192.9.5.5]/ipng 5]\n* [http://[::FFFF:129.144.52.38]:80/index.html 
6]\n* [http://[2010:836B:4179::836B:4179] 7]\nmdhhw6lx66crf6r\n");
-add("selser", "IPv6 urls, bracketed format (T23261) [1,3,1,0,1,0,3,0,1,2]", 
"[http://[2404:130:0:1000::187:2]/index.php test]\n\nExamples from RFC2373, 
section 2.2:\n* [http://[1080::8:800:200C:417A] unicast]\n* [http://[FF01::101] 
multicast]\n* [http://[::1]/ loopback]\n* [http://[::] unspecified]\n* 
[http://[::13.1.68.3] ipv4compat]\n* [http://[::FFFF:129.144.52.38] 
ipv4compat]\n\n* 
[http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html 1]\n* 
[http://[1080:0:0:0:8:800:200C:417A]/index.html 2]\n* 
[http://[3ffe:2a00:100:7031::1] 3]\n* [http://[1080::8:800:200C:417A]/foo 4]\n* 
[http://[::192.9.5.5]/ipng 5]\n* [http://[::FFFF:129.144.52.38]:80/index.html 
6]\n* [http://[2010:836B:4179::836B:4179] 7]\nylaxtj1na899hpvi\n");
-add("selser", "IPv6 urls, bracketed format (T23261) 
[[2,0,3],2,4,4,[2,0,0,0,[4],4,3,0,[4],0,2],0,2,4,[[3],0,0,4,1,4,4,0,0,0,2,3,1],0]",
 
"4loj1g0b4enopqfr[http://[2404:130:0:1000::187:2]/index.php\n\nbq5ur5jghyc766r\n\nsu4dk5qojb8rggb9\n\naejeb15ifh90y66r\n*
 9ielr196muhxgvi\n* [http://[1080::8:800:200C:417A] unicast]\n* 
[http://[FF01::101] multicast]\n*4398veu62t5fusor\n* 
b0j65g64g3u15rk9\n*0hneatj7aihbmx6r\n* maid257q2eghkt9\n* 
[http://[::FFFF:129.144.52.38] ipv4compat]\n\nd8gll3h6g6ekx1or\n\nExamples from 
RFC 2732, section 2:\n\njo2bmjhldjf9a4i\n*\n* 
[http://[1080:0:0:0:8:800:200C:417A]/index.html 2]\n* 8um06gyhf5tjfw29\n* 
[http://[3ffe:2a00:100:7031::1] 3]\n* s226rcty21fc4n29\n* qsa61rn8qdh4obt9\n* 
[http://[::192.9.5.5]/ipng 5]\n* wj591nm58ojsv2t9\n* 
[http://[::FFFF:129.144.52.38]:80/index.html 6]\n* 
[http://[2010:836B:4179::836B:4179] 7]\n");
-add("selser", "IPv6 urls, bracketed format (T23261) 
[1,0,1,0,[1,0,0,0,[4],4,[2],0,0,2,3],0,3,3,4,2]", 
"[http://[2404:130:0:1000::187:2]/index.php test]\n\nExamples from RFC2373, 
section 2.2:\n* [http://[1080::8:800:200C:417A] unicast]\n* [http://[FF01::101] 
multicast]\n*kiuipzvcl7agiudi\n* n8sc9y74vzi1kyb9\n*1nqvqe21faiz4cxr 
[http://[::] unspecified]\n* [http://[::13.1.68.3] ipv4compat]\n* 
ger1q87199e5qaor\n\ntrsd81mbn9418aor\n\ncg6bltbembexko6r\n");
-add("selser", "IPv6 urls, bracketed format (T23261) 
[[2,0,0],0,1,3,[3,0,[3],3,3,3,0,0,1,2,[2]],0,[2,[3],3],4,2,2]", 
"dpxubroztqi1kyb9[http://[2404:130:0:1000::187:2]/index.php test]\n\nExamples 
from RFC2373, section 2.2:\n*\n* [http://[::] unspecified]\n* 
[http://[::13.1.68.3] ipv4compat]\n* 906ccj8dza7nwmi\n*0dfejab033rqkt9 
[http://[::FFFF:129.144.52.38] ipv4compat]\n\n9yi0v4i9rzw4gqfrExamples from 
[//tools.ietf.org/html/rfc2732 ]\n\n43zgjgdoyrs5rk9\n\niiwbmj54o4c59udi\n* 
[http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html 1]\n* 
[http://[1080:0:0:0:8:800:200C:417A]/index.html 2]\n* 
[http://[3ffe:2a00:100:7031::1] 3]\n* [http://[1080::8:800:200C:417A]/foo 4]\n* 
[http://[::192.9.5.5]/ipng 5]\n* [http://[::FFFF:129.144.52.38]:80/index.html 
6]\n* [http://[2010:836B:4179::836B:4179] 7]\n14vsvb8lbejc3di\n");
-add("selser", "IPv6 urls, bracketed format (T23261) 
[2,4,4,2,[2,2,[4],0,[4],0,3,2,3,2,4],0,[0,3,2],2,[4,3,[2],0,3,2,4,0,0,0,0,2,4],3]",
 "r8mc0x9m86w29\n\n[http://[2404:130:0:1000::187:2]/index.php 
test]\n\ney90otxddmhlrf6r\n\nvldsbj6wlikymn29\n\nv0mlmnz2ms0xusor\n* 
r1fwnj79dmv4pldi\n* [http://[1080::8:800:200C:417A] unicast]\n* 
yc49o9ec65p9o1or\n*swtp6zirnm0wwmi\n*as87mrpje4p9zfr\n* 8dq7g6g4oiebfbt9\n* 
7t7q8lh7vfopf1or\n* pveahkk6j56x0f6r\n\nExamples from hy46042z2fpc766r, section 
2:\n\nq60pc01bmc0afw29\n* 9n851fzddu545cdi\n*gnduuwbj3ys0pb9 
[http://[1080:0:0:0:8:800:200C:417A]/index.html 2]\n* 88b33hvlp67gmn29\n* 
t8gd6exag67gmn29\n* [http://[::192.9.5.5]/ipng 5]\n* 
[http://[::FFFF:129.144.52.38]:80/index.html 6]\n* pa03zxzcum5tgldi\n* 
0mpzyjcl50rltyb9");
-add("selser", "IPv6 urls, bracketed format (T23261) 
[[0,2,0],4,[2],2,[1,3,1,0,[3],2,4,3,[3],2,1],0,[0,3,0],0,[1,0,0,0,[2],2,[2],4,[3],4,0,0,[3]],2]",
 "[3j8pbjj7aovzehfr<nowiki/>http://[2404:130:0:1000::187:2]/index.php 
test]\n\nzzfmllt0qoq7iudi\n\ngglj5oewapirizfrExamples from RFC2373, section 
2.2:\n\nw3j32grhujotuik9\n* [http://[1080::8:800:200C:417A] unicast]\n* 
[http://[FF01::101] multicast]\n*\n* 1a60jy2gf58w7b9\n* jpk3z738n3aqbyb9\n*\n* 
jahr0syy8wtdquxr\n* [http://[::FFFF:129.144.52.38] ipv4compat]\n\nExamples from 
, section 2:\n* [http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html 
1]\n* [http://[1080:0:0:0:8:800:200C:417A]/index.html 2]\n*jwnhh2isyqc6usor 
[http://[3ffe:2a00:100:7031::1] 3]\n* x534d18ilgyl23xr\n*a806emsnbyq77gb9 
[http://[1080::8:800:200C:417A]/foo 4]\n* v6w52jxgvjlnxw29\n*\n* 
9qma4fszhpaurf6r\n* [http://[::FFFF:129.144.52.38]:80/index.html 
6]\n*\n5w48q4pvh3yp66r\n");
 add("selser", "mw:ExtLink linking to a interwiki URL can be round-tripped 
losslessly (T94723) [[[4]]]", "[[wikipedia:European_Robin|w8te4gwhsniv0a4i]]");
 add("selser", "mw:ExtLink linking to a interwiki URL can be round-tripped 
losslessly (T94723) [[[2]]]", 
"[[wikipedia:European_Robin|jtvcvll5n6x0f6rEuropean Robin]]");
 add("selser", "Unclosed and unmatched quotes 
[[[0,0,4]],2,3,3,[1],0,4,0,1,2,[[2]],3,3,3,2,0,3,4,1,2,2]", "'''''Bold italic 
text '''with bold deactivated0bet2nehr3gl23xr''\n\nmveau9dj2krl766r\n\n'''Bold 
text..'''\n\ny75pk6fh55lba9k9\n\n'''Bold tag left 
open\n\nivecp7jd69h8semi\n\n''939vypv7nzalwhfrItalic tag left 
open''\n\n4jx8l4e2s9kymn29<!-- Unmatching number of opening, closing tags: 
-->\n\nftnac0njf7i1wcdi\n\n''Tom'''s car is bigger than 
'''''<nowiki/>'''Susan'''s.\n\nwv6k36cpnikbuik9\n\nvtz1rewhs7i7ldi\n\nPlain 
''italic'''s plain");
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index 04915dc..a7b0e9d 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -5358,7 +5358,7 @@
 !! wikitext
 http://[2404:130:0:1000::187:2]/index.php
 
-Examples from RFC2373, section 2.2:
+Examples from RFC 2373, section 2.2:
 * http://[1080::8:800:200C:417A]/unicast
 * http://[FF01::101]/multicast
 * http://[::1]/loopback
@@ -5375,9 +5375,9 @@
 * http://[::FFFF:129.144.52.38]:80/index.html
 * http://[2010:836B:4179::836B:4179]
 
-!! html
+!! html/php
 <p><a rel="nofollow" class="external free" 
href="http://[2404:130:0:1000::187:2]/index.php";>http://[2404:130:0:1000::187:2]/index.php</a>
-</p><p>Examples from RFC2373, section 2.2:
+</p><p>Examples from <a class="external mw-magiclink-rfc" rel="nofollow" 
href="//tools.ietf.org/html/rfc2373">RFC 2373</a>, section 2.2:
 </p>
 <ul><li> <a rel="nofollow" class="external free" 
href="http://[1080::8:800:200C:417A]/unicast";>http://[1080::8:800:200C:417A]/unicast</a></li>
 <li> <a rel="nofollow" class="external free" 
href="http://[FF01::101]/multicast";>http://[FF01::101]/multicast</a></li>
@@ -5395,6 +5395,25 @@
 <li> <a rel="nofollow" class="external free" 
href="http://[::FFFF:129.144.52.38]:80/index.html";>http://[::FFFF:129.144.52.38]:80/index.html</a></li>
 <li> <a rel="nofollow" class="external free" 
href="http://[2010:836B:4179::836B:4179]";>http://[2010:836B:4179::836B:4179]</a></li></ul>
 
+!! html/parsoid
+<p><a rel="mw:ExtLink" 
href="http://[2404:130:0:1000::187:2]/index.php";>http://[2404:130:0:1000::187:2]/index.php</a></p>
+
+<p>Examples from <a href="//tools.ietf.org/html/rfc2373" rel="mw:ExtLink">RFC 
2373</a>, section 2.2:</p>
+<ul><li> <a rel="mw:ExtLink" 
href="http://[1080::8:800:200C:417A]/unicast";>http://[1080::8:800:200C:417A]/unicast</a></li>
+<li> <a rel="mw:ExtLink" 
href="http://[FF01::101]/multicast";>http://[FF01::101]/multicast</a></li>
+<li> <a rel="mw:ExtLink" 
href="http://[::1]/loopback";>http://[::1]/loopback</a></li>
+<li> <a rel="mw:ExtLink" 
href="http://[::]/unspecified";>http://[::]/unspecified</a></li>
+<li> <a rel="mw:ExtLink" 
href="http://[::13.1.68.3]/ipv4compat";>http://[::13.1.68.3]/ipv4compat</a></li>
+<li> <a rel="mw:ExtLink" 
href="http://[::FFFF:129.144.52.38]/ipv4compat";>http://[::FFFF:129.144.52.38]/ipv4compat</a></li></ul>
+
+<p>Examples from <a href="//tools.ietf.org/html/rfc2732" rel="mw:ExtLink">RFC 
2732</a>, section 2:</p>
+<ul><li> <a rel="mw:ExtLink" 
href="http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html";>http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html</a></li>
+<li> <a rel="mw:ExtLink" 
href="http://[1080:0:0:0:8:800:200C:417A]/index.html";>http://[1080:0:0:0:8:800:200C:417A]/index.html</a></li>
+<li> <a rel="mw:ExtLink" 
href="http://[3ffe:2a00:100:7031::1]";>http://[3ffe:2a00:100:7031::1]</a></li>
+<li> <a rel="mw:ExtLink" 
href="http://[1080::8:800:200C:417A]/foo";>http://[1080::8:800:200C:417A]/foo</a></li>
+<li> <a rel="mw:ExtLink" 
href="http://[::192.9.5.5]/ipng";>http://[::192.9.5.5]/ipng</a></li>
+<li> <a rel="mw:ExtLink" 
href="http://[::FFFF:129.144.52.38]:80/index.html";>http://[::FFFF:129.144.52.38]:80/index.html</a></li>
+<li> <a rel="mw:ExtLink" 
href="http://[2010:836B:4179::836B:4179]";>http://[2010:836B:4179::836B:4179]</a></li></ul>
 !! end
 
 !! test
@@ -5402,7 +5421,7 @@
 !! wikitext
 [http://[2404:130:0:1000::187:2]/index.php test]
 
-Examples from RFC2373, section 2.2:
+Examples from RFC 2373, section 2.2:
 * [http://[1080::8:800:200C:417A] unicast]
 * [http://[FF01::101] multicast]
 * [http://[::1]/ loopback]
@@ -5419,9 +5438,9 @@
 * [http://[::FFFF:129.144.52.38]:80/index.html 6]
 * [http://[2010:836B:4179::836B:4179] 7]
 
-!! html
+!! html/php
 <p><a rel="nofollow" class="external text" 
href="http://[2404:130:0:1000::187:2]/index.php";>test</a>
-</p><p>Examples from RFC2373, section 2.2:
+</p><p>Examples from <a class="external mw-magiclink-rfc" rel="nofollow" 
href="//tools.ietf.org/html/rfc2373">RFC 2373</a>, section 2.2:
 </p>
 <ul><li> <a rel="nofollow" class="external text" 
href="http://[1080::8:800:200C:417A]";>unicast</a></li>
 <li> <a rel="nofollow" class="external text" 
href="http://[FF01::101]";>multicast</a></li>
@@ -5439,6 +5458,25 @@
 <li> <a rel="nofollow" class="external text" 
href="http://[::FFFF:129.144.52.38]:80/index.html";>6</a></li>
 <li> <a rel="nofollow" class="external text" 
href="http://[2010:836B:4179::836B:4179]";>7</a></li></ul>
 
+!! html/parsoid
+<p><a rel="mw:ExtLink" 
href="http://[2404:130:0:1000::187:2]/index.php";>test</a></p>
+
+<p>Examples from <a href="//tools.ietf.org/html/rfc2373" rel="mw:ExtLink">RFC 
2373</a>, section 2.2:</p>
+<ul><li> <a rel="mw:ExtLink" 
href="http://[1080::8:800:200C:417A]";>unicast</a></li>
+<li> <a rel="mw:ExtLink" href="http://[FF01::101]";>multicast</a></li>
+<li> <a rel="mw:ExtLink" href="http://[::1]/";>loopback</a></li>
+<li> <a rel="mw:ExtLink" href="http://[::]";>unspecified</a></li>
+<li> <a rel="mw:ExtLink" href="http://[::13.1.68.3]";>ipv4compat</a></li>
+<li> <a rel="mw:ExtLink" 
href="http://[::FFFF:129.144.52.38]";>ipv4compat</a></li></ul>
+
+<p>Examples from <a href="//tools.ietf.org/html/rfc2732" rel="mw:ExtLink">RFC 
2732</a>, section 2:</p>
+<ul><li> <a rel="mw:ExtLink" 
href="http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html";>1</a></li>
+<li> <a rel="mw:ExtLink" 
href="http://[1080:0:0:0:8:800:200C:417A]/index.html";>2</a></li>
+<li> <a rel="mw:ExtLink" href="http://[3ffe:2a00:100:7031::1]";>3</a></li>
+<li> <a rel="mw:ExtLink" href="http://[1080::8:800:200C:417A]/foo";>4</a></li>
+<li> <a rel="mw:ExtLink" href="http://[::192.9.5.5]/ipng";>5</a></li>
+<li> <a rel="mw:ExtLink" 
href="http://[::FFFF:129.144.52.38]:80/index.html";>6</a></li>
+<li> <a rel="mw:ExtLink" 
href="http://[2010:836B:4179::836B:4179]";>7</a></li></ul>
 !! end
 
 !! test

-- 
To view, visit https://gerrit.wikimedia.org/r/179231
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibb33188cdfe2004e469c3f6ee6f30d34d1923283
Gerrit-PatchSet: 13
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
Gerrit-Reviewer: Arlolra <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to