Subramanya Sastry has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/74110


Change subject: Take #2: (Bug 50841) Reduce scope of nowiki tags
......................................................................

Take #2: (Bug 50841) Reduce scope of nowiki tags

* This does a more thorough job of reducing scope of nowiki tags
  even if it is a tad more expensive to do.  Given that serialization
  is not that expensive overall, and only a small fraction of tests
  even qualify for the 'escapedText' routine, this is not a real
  concern.

* Updated expected output (=test input) for a number of tests to
  reflect the new nowiki scoping + regenerated selser changes.

* Four additional tests now fail
  1. "<nowiki> unordered list" in html2wt mode
     - because the HTML for html2wt comes from the php version which
       does not have Parsoid-specific types required for accurate
       html2wt-ing.  As a result, the HTML is treated as "new HTML"
       and the nowiki is applied to a smaller string than the input

  2. "<nowiki> spacing" in html2html mode
     - for similar reasons as 1. above

  3. "1. Leading whitespace in SOL context should be escaped" in html2wt mode
     - Because on retokenizing, tabs are converted to spaces by the
       indent-pre productions (known issue with tokenizer).  It is
       unclear if this is a big problem.  If tokenizer can preserve
       tabs in indent-pre position, this bug will go away.

  4. "Links 1. Quote marks in link text" in selser mode with changes [[[4,3]]]
     - Seems unrelated to the patch since the input has no
       escapable characters.  This is just a failure triggered
       by a new selser changes input that would have failed anyway.

Change-Id: I1048faad788ec89a196660ad7f29756dcdff672d
---
M js/lib/mediawiki.WikitextSerializer.js
M js/tests/parserTests-blacklist.js
M js/tests/parserTests.txt
M js/tests/selser.changes.json
4 files changed, 156 insertions(+), 111 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid 
refs/changes/10/74110/1

diff --git a/js/lib/mediawiki.WikitextSerializer.js 
b/js/lib/mediawiki.WikitextSerializer.js
index 5d59f5e..1cb873c 100644
--- a/js/lib/mediawiki.WikitextSerializer.js
+++ b/js/lib/mediawiki.WikitextSerializer.js
@@ -543,93 +543,133 @@
 // Make sure the initialState is never modified
 Util.deepFreeze( WSP.initialState );
 
-function escapedText(origText, fullWrap) {
-       // Full-wrapping is enabled in the following cases:
-       // * origText is a "small" string
-       // * origText has url triggers (RFC, ISBN, etc.)
-       // * is being escaped within context-specific handlers
+/* ----------------------------------------------------------------
+ * This function attempts to wrap smallest escapable units into
+ * nowikis (which can potentially add multiple nowiki pairs in a
+ * single string).  However, it does attempt to coaelse adjacent
+ * nowiki segments into a single nowiki wrapper.
+ *
+ * Full-wrapping is enabled in the following cases:
+ * - origText has url triggers (RFC, ISBN, etc.)
+ * - is being escaped within context-specific handlers
+ * ---------------------------------------------------------------- */
+WSP.escapedText = function(state, sol, origText, fullWrap) {
 
        var match = 
origText.match(/^((?:.*?|[\r\n]+[^\r\n]|[~]{3,5})*?)((?:\r?\n)*)$/),
                text = match[1],
                nls = match[2],
-               maxRunLength = 20;
+               nowikisAdded = false;
 
-       if (fullWrap || text.length < maxRunLength) {
+       // console.warn("SOL: " + sol + "; text: " + text);
+
+       if (fullWrap) {
                return ["<nowiki>", text, "</nowiki>", nls].join('');
        } else {
-               // For now, only optimize "[[..]]", "{{..}}", "{{{..}}}" 
scenarios
-               // Splitting on white-space, "=", ' chars can split html tags
-               // in the middle and create ugly nowiki escaping output.
-               var pieces = text.split(/(\[\[|\]\]|\{\{\{|\{\{|\}\}\}|\}\})/g),
-                       n = pieces.length,
-                       buf = n === 1 ?  ["<nowiki>", text, "</nowiki>"] : [];
+               var buf = [],
+                       inNowiki = false,
+                       tokensWithoutClosingTag = Util.arrayToHash([
+                               // These token types don't come with a closing 
tag
+                               'listItem', 'td', 'tr'
+                       ]);
 
-               if (n > 1) {
-                       var openTag = null,
-                               openNowiki = false,
-                               canBeClosed = false,
-                               currentRunLength = 0,
-                               closingWtTagMap = { "[[" : "]]", "{{" : "}}", 
"{{{": "}}}" };
+               // Tokenize string and pop EOFTk
+               var tokens = this.tokenizeStr(state, text, sol);
+               tokens.pop();
 
-                       for (var i = 0; i < n; i++) {
-                               var p = pieces[i];
-                               if (!openTag) {
-                                       if (p in closingWtTagMap) {
-                                               openTag = p;
-                                               canBeClosed = false;
-                                               if (!openNowiki) {
-                                                       buf.push("<nowiki>");
-                                                       openNowiki = true;
-                                               }
-                                       } else if (
-                                                       // [..], <..>, '', ~~~~
-                                                       
p.match(/\[[^\[\]]\]|<[^<>]*>|''|~{3,5}/) ||
-                                                       // If in SOL (previous 
piece ended in a \n), or after a \n,
-                                                       // \s+ (indent-pre), = 
(headings), *#;: (lists), {| |}, |, ||, |-, |+, ! (tables)
-                                                       p.match(/\n([ 
\t]+[^\s]+|[=:;#\*]|\s*(\{\||\|\}|\|[\|\-\+]?|!))/) ||
-                                                       ((i === 0 || 
pieces[i-1].match(/\n$/)) && p.match(/^([ 
\t]+[^\s]+|=:;#\*|\s*(\{\||\|\}|\|[\|\-\+]?|!))/))
-                                               )
-                                       {
-                                               canBeClosed = false;
-                                               if (!openNowiki) {
-                                                       buf.push("<nowiki>");
-                                                       openNowiki = true;
-                                               }
-                                       }
-                               } else {
-                                       if (p === closingWtTagMap[openTag]) {
-                                               openTag = null;
-                                       }
+               // Add nowikis intelligently
+               var smartNowikier = function(open, close, text, i, numToks) {
+                       // Max length of string that gets "unnecessarily"
+                       // sucked into a nowiki (15 is an arbitrary number)
+                       var maxExcessWrapLength = 15;
+
+                       // If we are being asked to close a nowiki
+                       // without opening one, we open a nowiki.
+                       //
+                       // Ex: "</s>" will parse to an end-tag
+                       if (open || (close && !inNowiki)) {
+                               if (!inNowiki) {
+                                       buf.push("<nowiki>");
+                                       inNowiki = true;
+                                       nowikisAdded = true;
                                }
+                       }
 
-                               if (canBeClosed && p.length > 0.2*maxRunLength) 
{
+                       buf.push(text);
+
+                       if (close) {
+                               if (i >= numToks-2 ||
+                                       tokens[i+1].constructor !== String ||
+                                       tokens[i+1].length >= 
maxExcessWrapLength)
+                               {
                                        buf.push("</nowiki>");
-                                       openNowiki = false;
-                                       canBeClosed = false;
-                                       currentRunLength = 0;
-                               }
-
-                               buf.push(p);
-
-                               // Push </nowiki> if:
-                               // - we are in the middle of an open <nowiki>,
-                               // - we are not in the middle of an open tag,
-                               // - and will cross maxRunLength length on the 
next piece
-                               currentRunLength += p.length;
-                               if (!openTag && openNowiki && (i < n-1 && 
pieces[i+1].length + currentRunLength >= maxRunLength)) {
-                                       canBeClosed = true;
+                                       inNowiki = false;
                                }
                        }
+               };
 
-                       if (openNowiki) {
-                               buf.push("</nowiki>");
+               for (var i = 0, n = tokens.length; i < n; i++) {
+                       var t = tokens[i],
+                               tsr = (t.dataAttribs || {}).tsr;
+
+                       // console.warn("SOL: " + sol + "; T[" + i + "]=" + 
JSON.stringify(t));
+
+                       switch (t.constructor) {
+                       case String:
+                               if (t.length > 0) {
+                                       if (sol && t.match(/(^|\n)[ \t]/)) {
+                                               smartNowikier(true, true, t, i, 
n);
+                                       } else {
+                                               buf.push(t);
+                                       }
+                                       sol = false;
+                               }
+                               break;
+
+                       case pd.NlTk:
+                               sol = true;
+                               // Fall through
+                       case pd.CommentTk:
+                               buf.push(text.substring(tsr[0], tsr[1]));
+                               break;
+
+                       case pd.TagTk:
+                               // Treat tokens with missing tags as 
self-closing tokens
+                               // for the purpose of minimal nowiki escaping
+                               var closeNowiki = 
tokensWithoutClosingTag[t.name];
+                               smartNowikier(true, closeNowiki, 
text.substring(tsr[0], tsr[1]), i, n);
+                               sol = false;
+                               break;
+
+                       case pd.EndTagTk:
+                               smartNowikier(false, true, 
text.substring(tsr[0], tsr[1]), i, n);
+                               sol = false;
+                               break;
+
+                       case pd.SelfclosingTagTk:
+                               smartNowikier(true, true, 
text.substring(tsr[0], tsr[1]), i, n);
+                               sol = false;
+                               break;
                        }
+               }
+
+               // close any unclosed nowikis
+               if (inNowiki) {
+                       buf.push("</nowiki>");
+               }
+
+               // Make sure nowiki is always added
+               // Ex: "foo]]" won't tokenize into tags at all
+               if (!nowikisAdded) {
+                       buf = [];
+                       buf.push("<nowiki>");
+                       buf.push(text);
+                       buf.push("</nowiki>");
                }
 
                buf.push(nls);
                return buf.join('');
        }
-}
+};
 
 WSP.tokenizeStr = function(state, str, sol) {
        var p = new PegTokenizer( state.env ), tokens = [];
@@ -674,7 +714,7 @@
        var wteHandler = state.wteHandlerStack.last();
        if (wteHandler && wteHandler(state, text, opts)) {
                // console.warn("---EWT:F2---");
-               return escapedText(text, true);
+               return this.escapedText(state, false, text, true);
        }
 
        // Template and template-arg markers are escaped unconditionally!
@@ -682,7 +722,7 @@
        // of whether we are in template arg context or not.
        if (text.match(/\{\{\{|\{\{|\}\}\}|\}\}/)) {
                // console.warn("---EWT:F3---");
-               return escapedText(text, fullCheckNeeded);
+               return this.escapedText(state, false, text, fullCheckNeeded);
        }
 
        // Escape quotes that come after I/B nodes that can be reparsed
@@ -691,7 +731,7 @@
                var prev = opts.node && opts.node.previousSibling ? 
opts.node.previousSibling.nodeName : '';
                if (prev === 'I' || prev === 'B') {
                        // console.warn("---EWT:F3b---");
-                       return escapedText(text, true);
+                       return this.escapedText(state, false, text, true);
                }
        }
 
@@ -726,7 +766,7 @@
        // So, we always conservatively escape text with ' ' in sol posn.
        if (sol && text.match(/(^|\n)[ \t]+[^\s]+/)) {
                // console.warn("---EWT:F6---");
-               return escapedText(text, fullCheckNeeded);
+               return this.escapedText(state, sol, text, fullCheckNeeded);
        }
 
        // escape nowiki tags
@@ -739,11 +779,11 @@
        // hasWikitextTokens check
        if (this.wteHandlers.hasWikitextTokens(state, sol, text) || hasTildes) {
                // console.warn("---EWT:DBG1---");
-               return escapedText(text, fullCheckNeeded);
+               return this.escapedText(state, sol, text, fullCheckNeeded);
        } else if (state.onSOL) {
                if (text.match(/(^|\n)=+[^\n=]+=+[ \t]*\n/)) {
                        // console.warn("---EWT:DBG2a---");
-                       return escapedText(text, fullCheckNeeded);
+                       return this.escapedText(state, sol, text, 
fullCheckNeeded);
                } else if (text.match(/(^|\n)=+[^\n=]+=+[ \t]*$/)) {
                        /* 
---------------------------------------------------------------
                         * '$' is only specific to 'text' and not the entire 
line.
@@ -774,7 +814,7 @@
                                DU.isText(nonSepSibling) && 
nonSepSibling.nodeValue.match(/^\s*\n/))
                        {
                                // console.warn("---EWT:DBG2b---");
-                               return escapedText(text, fullCheckNeeded);
+                               return this.escapedText(state, sol, text, 
fullCheckNeeded);
                        } else {
                                // console.warn("---EWT:DBG2c---");
                                return text;
@@ -829,7 +869,7 @@
                                this.wteHandlers.hasWikitextTokens(state, sol, 
cl.text + text, true))
                {
                        // console.warn("---EWT:DBG4---");
-                       return escapedText(text, fullCheckNeeded);
+                       return this.escapedText(state, sol, text, 
fullCheckNeeded);
                } else {
                        // console.warn("---EWT:DBG5---");
                        return text;
diff --git a/js/tests/parserTests-blacklist.js 
b/js/tests/parserTests-blacklist.js
index 5a41ded..3b26184 100644
--- a/js/tests/parserTests-blacklist.js
+++ b/js/tests/parserTests-blacklist.js
@@ -707,6 +707,7 @@
 add("html2html", "Italics and bold: other quote tests: (3,2,3,2)");
 add("html2html", "Italics and bold: other quote tests: (3,2,3,3) (parsoid)");
 add("html2html", "Italicized possessive");
+add("html2html", "<nowiki> spacing");
 add("html2html", "nowiki 3");
 add("html2html", "Preformatted text");
 add("html2html", "<pre> with attributes (bug 3202)");
@@ -1236,6 +1237,7 @@
 add("html2wt", "Italics and bold: other quote tests: (3,2,3,2)");
 add("html2wt", "Italics and bold: other quote tests: (3,2,3,3) (parsoid)");
 add("html2wt", "Italicized possessive");
+add("html2wt", "<nowiki> unordered list");
 add("html2wt", "<nowiki> spacing");
 add("html2wt", "nowiki 3");
 add("html2wt", "Entities inside <nowiki>");
@@ -2123,6 +2125,7 @@
 add("html2wt", "Tables: 1d. No escaping needed");
 add("html2wt", "Tables: 4d. No escaping needed");
 add("html2wt", "Links 2. WikiLinks: Escapes needed");
+add("html2wt", "1. Leading whitespace in SOL context should be escaped");
 add("html2wt", "HTML tag with 'unnecessary' entity encoding in attributes");
 add("html2wt", "HTML tag with broken attribute value quoting");
 add("html2wt", "Parsoid-only: HTML tag with broken attribute value quoting");
@@ -3771,6 +3774,7 @@
 add("selser", "Tables: 4d. No escaping needed [[3,[[[3],3,2],4]]]");
 add("selser", "Tables: 4d. No escaping needed [[2,[2,0]]]");
 add("selser", "Tables: 4d. No escaping needed [[2,[[0,4,2],0]]]");
+add("selser", "Links 1. Quote marks in link text [[[4,3]]]");
 add("selser", "HTML tag with broken attribute value quoting [2]");
 add("selser", "HTML tag with broken attribute value quoting [1]");
 add("selser", "HTML tag with broken attribute value quoting [2]");
diff --git a/js/tests/parserTests.txt b/js/tests/parserTests.txt
index 13a7694..edd4d08 100644
--- a/js/tests/parserTests.txt
+++ b/js/tests/parserTests.txt
@@ -14928,7 +14928,7 @@
 parsoid
 !! input
 =foo=
-<nowiki>*bar</nowiki>
+<nowiki>*</nowiki>bar
 
 =foo=
 =bar
@@ -15029,11 +15029,11 @@
 !! input
 <nowiki>=a=</nowiki>
 
-<nowiki>=a= </nowiki>
+<nowiki>=a=</nowiki> 
 
-<nowiki>=a=    </nowiki>
+<nowiki>=a=</nowiki>   
 
-<nowiki>=a=    </nowiki>
+<nowiki>=a=</nowiki>   
 !! result
 <p>=a=</p>
 <p>=a= </p>
@@ -15046,8 +15046,8 @@
 !! options
 parsoid
 !! input
-<nowiki>=a=
-b</nowiki>
+<nowiki>=a=</nowiki>
+b
 
 <nowiki>=a= 
 b</nowiki>
@@ -15074,8 +15074,8 @@
 !! options
 parsoid
 !! input
-<nowiki>a
-=b=</nowiki>
+a
+<nowiki>=b=</nowiki>
 !! result
 <p>a
 =b=</p>
@@ -15088,7 +15088,7 @@
 !! input
 <!--c0--><nowiki>=a=</nowiki>
 <!--c1-->
-<nowiki>=a= </nowiki><!--c2-->  <!--c3-->
+<nowiki>=a=</nowiki> <!--c2-->  <!--c3-->
 !! result
 <p><!--c0-->=a=</p>
 <p><!--c1-->=a= <!--c2-->       <!--c3--></p>
@@ -15118,9 +15118,9 @@
 !! test
 Lists: 0. Outside nests
 !! input
-<nowiki>*foo</nowiki>
+<nowiki>*</nowiki>foo
 
-<nowiki>#foo</nowiki>
+<nowiki>#</nowiki>foo
 !! result
 <p>*foo
 </p><p>#foo
@@ -15265,8 +15265,8 @@
 !! test
 Lists: 7. Escape bullets in a multi-line context
 !! input
-<nowiki>a
-*b</nowiki>
+a
+<nowiki>*</nowiki>b
 !! result
 <p>a
 *b
@@ -15524,7 +15524,7 @@
 !! options
 parsoid
 !! input
-[[Foo|<nowiki>Foo''boo''</nowiki>]]
+[[Foo|Foo<nowiki>''boo''</nowiki>]]
 !! result
 <a rel="mw:WikiLink" href="Foo">Foo''boo''</a>
 !! end
@@ -15680,24 +15680,24 @@
 !! options
 parsoid
 !! input
-<nowiki> a</nowiki>
+<nowiki> </nowiki>a
 
-<nowiki>  a</nowiki>
+<nowiki> </nowiki> a
 
-<nowiki>       a(tab)</nowiki>
+<nowiki>       </nowiki>a(tab)
 
-<nowiki>       a</nowiki>
+<nowiki> </nowiki>     a
 <!--cmt-->
-<nowiki>  a</nowiki>
+<nowiki> </nowiki> a
 
-<nowiki>a
- b</nowiki>
+a
+<nowiki> </nowiki>b
 
-<nowiki>a
-       b</nowiki>
+a
+<nowiki>       </nowiki>b
 
-<nowiki>a
-        b</nowiki>
+a
+<nowiki>       </nowiki> b
 !! result
 <p> a</p>
 <p>  a</p>
@@ -15730,8 +15730,8 @@
 !! test
 2. other tags
 !! input
-<nowiki><div>foo</div>
-<div style="color:red">foo</div></nowiki>
+<nowiki><div>foo</div></nowiki>
+<nowiki><div style="color:red">foo</div></nowiki>
 !! result
 <p>&lt;div&gt;foo&lt;/div&gt;
 &lt;div style=&quot;color:red&quot;&gt;foo&lt;/div&gt;
diff --git a/js/tests/selser.changes.json b/js/tests/selser.changes.json
index 608650c..24891d0 100644
--- a/js/tests/selser.changes.json
+++ b/js/tests/selser.changes.json
@@ -644,6 +644,7 @@
 "Category with template in sort key and title":[0],
 "Category / paragraph 
interactions":[[1,2,4,0,[0,4,0],4,3,3,[0,4],3,[1],0,0,0,1,3,1,0,4,0,0,0,0,3,0,4,0],[[0,3,2],0,2,4,[3,2,0],0,[2,2,0],0,3,0,[2],3,4,2,3,3,2,0,3,4,0,4,3,0,0,2,0],[[2,0,0],0,4,0,[4,0,0],3,2,0,0,0,0,3,1,3,0,0,1,0,2,0,0,0,3,3,0,4,1],[3,2,1,3,0,4,1,2,1,3,[2],0,0,0,0,4,0,0,0,3,4,2,4,4,0,4,0],[0,3,[4,0,4],3,4,2,[4,2,2],2,[0,2],0,2,3,0,2,[2],0,0,0,0,0,2,0,0,0,0,4,4],[4,0,0,0,[4,1,0],3,3,0,0,2,[2],0,0,2,2,0,0,0,1,3,0,2,0,2,0,0,4],[[0,2,3],2,[0,1,0],0,0,4,0,0,2,3,0,0,1,4,0,0,0,0,4,3,0,0,1,0,0,4,4],[[4,0,2],0,2,2,2,0,1,0,[4,0],0,0,0,2,3,3,0,4,0,1,0,0,0,4,0,2,0,0],[[2,3,3],2,4,2,1,3,[2,0,0],3,1,2,4,3,0,0,4,2,4,4,3,0,1,4,0,0,0,0,2],[0,2,4,2,[2,4,0],3,[0,4,2],2,2,0,1,3,0,0,0,0,1,3,2,4,0,4,4,4,0,0,2],[[0,1,0],0,[2,0,4],4,[0,2,4],0,1,0,0,0,3,0,2,0,[2],0,2,3,0,0,0,2,2,0,3,0,4],[[3,0,0],3,1,0,[4,0,0],0,1,3,3,2,1,4,0,4,0,4,1,0,[2],3,2,0,4,0,0,0,0],[[0,3,3],4,4,0,3,3,3,0,0,3,0,3,2,0,[4],2,0,4,0,4,1,2,0,0,0,0,0],[[3,1,3],3,[0,2,4],3,2,3,4,0,[3,2],4,1,4,4,0,0,2,0,4,[4],3,0,3,0,0,0,0,0],[[4,0,0],3,3,2,[3,3,0],4,3,4,2,2,[2],0,0,0,0,0,0,2,3,0,3,0,4,0,1,2,3],[1,0,1,0,1,0,1,0,0,2,[4],0,0,0,[4],0,3,0,4,0,0,2,4,4,0,3,0],[[0,0,2],2,[4,1,0],0,[0,1,0],0,2,0,3,0,0,0,2,0,[4],2,4,0,4,2,0,4,0,4,1,2,4],[1,4,4,0,2,3,[0,4,0],0,4,0,3,0,3,0,[4],3,0,0,1,2,0,4,0,0,3,0,0],[[4,0,4],0,[0,2,0],0,[2,1,4],0,1,0,0,2,2,0,3,0,4,0,4,0,2,4,4,4,4,0,0,3,0],[1,3,4,4,3,3,1,0,[0,3],0,[2],3,0,0,[4],0,0,4,0,2,1,0,0,0,2,0,2]],
 "Parsoid: Serialize link to category page with colon 
escape":[[2,2],[0,2],[0,[4,4,[3]]],[4,3],[0,[0,0,2]],[0,[[3],4,[4]]],[0,1],[0,[3,4,[3]]],[2,[4,3,2]],[0,[[2],3,[4]]],[3,[[4],0,0]],[3,3],[3,[0,2,0]],[3,2],[0,4],[2,[3,0,[2]]],[0,[0,4,0]],[0,[0,0,4]],[0,3],[4,[[2],0,3]]],
+"Parsoid: Link prefix/suffixes aren't applied to category links":[],
 "Parsoid: Serialize link to file page with colon 
escape":[[0,[0,0,[4]]],[0,2],[0,[0,4,0]],[0,3],[2,[2,0,0]],[0,[3,4,2]],[4,2],[4,3],[0,[0,3,3]],[2,[0,0,1]],[3,4],[3,[4,4,1]],[0,[1,2,4]],[3,[2,3,0]],[0,[2,0,[4]]],[0,1],[2,1],[4,[1,0,[3]]],[4,4],[0,[4,0,0]]],
 "Parsoid: Serialize a genuine category link without colon 
escape":[[4,0,1],[3,4,0],[0,0,4],0,[0,2,1],[0,3,4],[3,4,4],[3,0,2],[1,3,3],[0,2,0],[3,0,1],[2,0,0],[1,0,2],[1,2,0],[0,0,1],[1,0,0],[0,2,3],[1,3,2],[3,0,0],[0,0,2]],
 "Inter-language 
links":[[0,2,4,4,0],[0,3,2,0,0],[2,0,4,0,2],[2,0,0,0,2],[0,3,3,0,0],[2,0,0,4,0],[4,4,0,3,1],[2,4,0,0,1],[0,0,3,4,0],[3,3,0,0,0],[0,0,4,4,0],[0,0,4,0,0],[4,4,0,2,0],[2,4,4,2,0],[0,3,0,0,0],[2,3,0,2,0],[0,4,0,0,2],[0,4,1,2,1],[0,3,3,2,1],[4,0,0,0,3]],
@@ -1057,24 +1058,24 @@
 "References: 6. <references /> from a transclusion":[0],
 "Headings: 0. 
Unnested":[[0,4,4,2,[2,[3],[4]]],[1,2,[[3],0,2,2,2],0,[0,[2],0]],[1,3,[1,0,0,0,1],4,3],[4,0,3,3,2],[[3],0,3,3,4],[[1],0,4,3,3],[2,0,2,0,3],[3,0,2,2,2],[[3],2,1,0,[0,1,[2]]],[[3],0,[[3],0,3,4,0],0,[0,[2],2]],[[[4]],2,2,0,4],[[4],3,2,3,[0,4,[4]]],[4,3,2,0,3],[[[3]],3,1,3,[4,[3],1]],[[[3]],0,[4,0,2,0,4],0,[4,4,[3]]],[1,4,3,0,[0,[4],[3]]],[4,2,[[2],4,0,3,[3]],2,1],[0,0,1,3,1],[[[4]],2,2,4,3],[[1],0,[0,0,4,2,0],0,[0,0,3]]],
 "Headings: 1. Nested inside 
html":[[0,2,4,2,3,0,0,4,[[3]],0,4],[4,3,4,0,0,0,[[3]],3,[1],4,[[4]]],[1,2,3,4,1,2,1,3,1,0,1],[3,3,[3],0,4,0,[[3]],3,[[4]],0,4],[1,0,[[3]],3,3,4,1,4,0,0,2],[2,4,[1],0,2,0,3,2,0,2,1],[0,0,4,0,1,4,2,4,[1],0,[1]],[2,0,4,0,[[3]],4,4,0,1,2,2],[4,4,4,0,2,0,3,0,4,0,3],[2,4,[1],0,0,2,[4],0,1,2,1],[1,3,[[4]],0,3,0,0,0,1,0,3],[[2],4,0,3,[[2]],0,3,0,0,0,1],[4,2,4,0,[1],3,3,0,3,0,[[2]]],[[[2]],0,[[2]],0,[[3]],4,3,0,3,0,[[2]]],[4,0,2,0,[[3]],0,4,0,2,3,[4]],[[4],0,3,2,[3],4,1,2,0,0,4],[[2],0,3,0,3,3,3,4,[[3]],0,4],[0,3,0,2,0,0,[1],0,2,2,[[2]]],[[3],3,3,0,0,0,2,4,[3],0,1],[1,2,0,0,[[2]],3,3,2,0,0,[[3]]]],
-"Headings: 2. Outside heading nest on a single line 
<h1>foo</h1>*bar":[[0,0,[2],0,[3],3,2,0,2,0,[[2]]],[[4],4,1,2,4,0,1,0,2,3,0],[[2],2,[[3]],0,[4],2,[4],4,2,0,3],[0,3,[[4]],0,3,0,4,4,[3],0,[4]],[1,0,1,0,2,2,0,0,2,0,[[2]]],[[3],0,2,2,0,2,[4],0,4,0,1],[0,4,[[2]],2,0,2,[3],3,[4],2,1],[3,2,2,4,2,3,0,3,1,0,[1]],[2,4,1,0,[2],0,0,4,0,0,1],[0,2,4,2,0,0,2,0,1,3,3],[[3],0,4,0,[3],0,1,0,4,0,1],[2,2,[[3]],4,[3],3,4,0,[3],0,[1]],[4,3,[[2]],2,[4],3,[3],0,1,0,[[3]]],[1,3,[3],2,[4],0,0,3,0,0,[2]],[1,2,[[3]],4,3,0,3,2,[3],0,[[2]]],[4,0,4,0,[4],0,3,2,2,4,[[2]]],[3,2,0,2,3,2,2,4,0,0,3],[2,3,3,0,[2],0,1,0,0,0,1],[[4],2,[[2]],0,[2],0,[2],4,0,2,3],[[4],3,[[4]],0,2,0,0,3,0,4,4]],
+"Headings: 2. Outside heading nest on a single line 
<h1>foo</h1>*bar":[[0,0,[2,0],0,3,3,2,0,2,0,[[2]]],[[4],4,1,2,4,0,1,0,2,3,0],[[2],2,[[3],0],0,3,2,[4],4,2,0,3],[0,3,[[4],0],3,[4],4,[3],0,[4],0,1],[1,0,1,0,2,2,0,0,2,0,[[2]]],[[3],0,2,2,0,2,[4],0,4,0,1],[0,4,[[2],2],0,[2],0,3,3,[4],2,1],[3,2,2,4,2,3,0,3,1,0,[1]],[2,4,1,0,[2],0,0,4,0,0,1],[0,2,4,2,0,0,2,0,1,3,3],[[3],0,4,0,[3],0,1,0,4,0,1],[2,2,[[3],4],0,3,3,4,0,[3],0,[1]],[4,3,[[2],2],0,4,3,[3],0,1,0,[[3]]],[1,3,[3,2],0,4,0,0,3,0,0,[2]],[1,2,[[3],4],3,[4],2,[3],0,0,2,[3]],[4,0,4,0,[4],0,3,2,2,4,[[2]]],[3,2,[0,2],3,2,3,4,0,0,3,3],[2,3,3,0,[2],0,1,0,0,0,1],[[4],2,[[2],0],0,1,0,[2],4,0,2,3],[[4],3,[[4],0],2,0,0,2,0,[4],4,2]],
 "Headings: 3. Nested inside html with wikitext split by html 
tags":[[4],[[3,3,3]],[[0,4,3]],[[0,[4],4]],[[0,[3],[3]]],[[0,[4],[4]]],[3],[[0,0,3]],[[0,0,[2]]],[1],[2],[[4,[3],1]],[[0,0,[4]]],[[0,3,3]],[[3,[2],4]],[[0,1,1]],[[4,3,0]],0,[[2,4,3]],[[4,0,4]]],
 "Headings: 4a. No escaping needed (testing just h1 and 
h2)":[[2,0,0,0,3,2,[3],0,4,4,2,2,1,4,[4]],[3,0,2,4,3,0,4,0,4,0,[2],0,[0,4],0,[2]],[0,0,0,2,0,0,[3],0,[3],3,2,3,0,4,0],[0,0,1,0,2,3,0,3,[4],4,2,0,1,2,2],[[3],0,3,0,[2],0,0,0,1,2,[2],4,0,0,1],[2,0,4,0,0,4,[3],0,3,0,0,4,[[4],0],3,0],[[4],0,[4],0,[3],4,[2],0,1,4,1,0,4,4,2],[4,2,2,0,[3],2,4,0,[2],0,0,2,4,2,[3]],[2,0,0,4,0,4,0,3,[2],2,1,3,1,3,[3]],[4,3,4,0,0,0,0,2,3,0,4,2,2,0,2],[0,4,4,3,2,0,2,0,[2],3,0,2,[2,0],3,4],[2,3,[2],0,3,0,0,0,1,0,2,0,2,2,[[3]]],[2,4,4,3,0,0,4,4,2,2,[2],0,0,4,3],[2,4,3,3,0,0,0,4,[2],0,0,2,3,0,[4]],[0,0,0,0,[4],0,1,2,[4],2,[4],4,[4,0],0,[2]],[0,2,0,4,1,3,1,0,3,2,[4],0,[0,4],2,0],[3,0,2,0,4,0,0,3,4,2,[4],3,4,4,[1]],[0,0,0,0,3,0,[3],0,1,4,3,3,0,0,0],[3,4,1,0,3,3,4,0,0,2,2,2,4,3,[3]],[[3],3,2,0,0,0,[4],0,[4],0,0,0,1,2,3]],
 "Headings: 4b. No escaping needed (inside 
p-tags)":[0,[3],[[0,4]],[2],[[2,3]],[1],[[2,0]],[[0,1]],[[0,3]],[4],[[3,0]],[[4,0]],[[0,2]],[[4,1]],[[3,1]],[[3,3]],[[2,1]],[[3,2]],[[3,4]],[[4,4]]],
 "Headings: 5. Empty 
headings":[[4,4,[2],3,[4],0,1,4,3,0,2],[0,4,[1],2,2,0,[3],4,2,0,4],[2,0,0,3,[3],2,3,3,[3],0,1],[[1],4,0,4,2,4,0,2,0,0,0],[4,0,[1],4,4,0,[4],3,4,0,[1]],[2,3,2,0,2,0,[1],2,0,3,3],[[3],0,[1],0,4,4,4,0,[1],4,3],[4,0,[3],0,3,0,1,4,3,0,1],[1,0,[2],2,[4],3,4,0,0,3,[3]],[3,0,1,2,0,3,1,4,[1],2,[3]],[0,0,0,3,2,2,4,0,0,2,2],[3,0,[2],4,0,0,2,4,[3],0,3],[[2],0,0,0,0,4,[1],0,3,0,[4]],[[2],0,[3],4,[1],0,[4],0,1,2,0],[[1],0,[1],0,1,3,0,2,3,0,[1]],[1,2,3,0,1,4,[2],0,4,0,0],[[1],0,0,0,3,2,[4],2,4,4,[2]],[2,4,4,4,1,4,0,0,[2],2,3],[[2],3,2,0,4,4,0,2,1,3,0],[4,3,0,0,1,3,0,3,0,0,2]],
-"Headings: 6a. Heading chars in SOL context (with trailing 
spaces)":[[[[2]],3,[3],0,4,0,4],[[4],0,1,0,3,0,[[4]]],[[[2]],4,[[3]],0,0,4,[[2]]],[[4],4,[2],0,[[3]],0,[2]],[4,3,[[2]],4,4,0,3],[0,0,3,0,3,0,[4]],[4,2,[[4]],0,0,0,[[2]]],[2,4,3,3,4,0,1],[2,0,2,4,0,4,0],[2,3,0,4,3,3,[1]],[[2],0,2,0,[[4]],2,0],[4,0,1,0,4,4,[2]],[[2],2,0,0,3,0,[2]],[[4],0,4,3,[2],0,[[4]]],[2,0,[[4]],0,[[3]],0,[[2]]],[2,0,3,0,[1],0,1],[3,0,2,0,2,4,[3]],[1,0,[4],0,[1],3,2],[0,0,3,0,0,3,3],[1,0,3,0,4,4,0]],
-"Headings: 6b. Heading chars in SOL context (with trailing 
newlines)":[[[2],0,[3],0,[[4]],0,3],[2,2,[4],0,[[2]],4,1],[2,3,[4],4,2,0,3],[4,2,1,4,[2],0,[2]],[[1],3,2,0,3,0,1],[[[2]],2,4,0,1,3,[4]],[1,0,[[3]],4,1,3,3],[1,0,[3],0,0,0,[[3]]],[4,3,2,3,0,0,1],[4,3,0,3,1,3,[4]],[[2],3,[1],4,0,0,1],[[2],2,3,0,3,0,4],[2,0,0,0,[[2]],0,[[3]]],[0,2,0,0,2,0,2],[3,0,0,2,[4],0,[2]],[3,2,2,0,4,0,[3]],[4,0,[2],0,4,2,2],[[2],2,0,0,[2],0,4],[1,0,[4],2,2,3,3],[[[2]],0,3,0,1,0,[2]]],
-"Headings: 6c. Heading chars in SOL context (leading newline 
break)":[[1],[4],[2],0,[[[3]]],[3],[[4]],[[3]],[[1]],[[[2]]],[[2]],[[[4]]]],
-"Headings: 6d. Heading chars in SOL context (with interspersed 
comments)":[[[3,4,3,0,2,2,0,2,2]],[[0,1,4,2,2,[3],0,2,4]],[[0,3,4,3,0,[2],0,0,4]],[3],[[0,0,0,2,0,4,4,0,4]],[[0,2,3,3,2,0,3,0,0]],[1],[[3,1,0,0,4,4,0,0,3]],[[0,2,2,0,2,3,0,0,0]],[[0,0,0,2,3,1,4,4,3]],[2],[[0,[2],0,4,2,[4],2,0,2]],[[0,[2],0,0,0,4,0,4,3]],[[3,1,0,3,3,[3],4,4,2]],[[2,3,2,2,2,3,0,0,3]],[[4,0,0,0,0,1,0,2,4]],[[0,0,0,0,4,1,2,0,4]],[[4,1,0,2,0,3,3,2,0]],[[4,4,0,3,0,4,0,3,0]],[4]],
+"Headings: 6a. Heading chars in SOL context (with trailing 
spaces)":[[[[2]],3,[3,0],4,[4,0],0,1],[[4],0,1,0,3,0,[[4],0]],[[[2]],4,[[3],0],0,[[4],0],0,1],[[4],4,[2,0],0,[2,0],0,2],[4,3,[[2],4],4,[3,0],0,3],[0,0,3,0,3,0,[4,3]],[4,2,[[4],0],0,0,0,2],[2,4,3,3,4,0,1],[2,0,2,4,[0,4],0,[[3],2]],[2,3,[0,4],3,3,0,1],[[2],0,2,0,[[4],2],0,[0,3]],[4,0,1,0,4,4,[2,3]],[[2],2,0,4,[[2],4],0,[[3],0]],[[4],0,4,3,[2,0],0,[4,4]],[2,0,[[4],0],0,[2,0],0,[1,4]],[2,0,3,0,[1,0],2,[1,0]],[3,0,2,0,2,4,[3,0]],[1,0,[4,0],0,1,3,2],[0,0,3,0,[0,3],3,[2,0]],[1,0,3,0,4,4,0]],
+"Headings: 6b. Heading chars in SOL context (with trailing 
newlines)":[[[2,0],0,3,0,[[4]],0,3],[2,2,[4],0,[[2]],4,1],[2,3,[4],4,2,0,3],[4,2,1,4,[2],0,[2]],[[1,3],2,[3],0,1,4,2],[[[2],2],4,[1],3,[4],3,4],[1,0,[[3]],4,1,3,3],[1,0,[3],0,0,0,[[3]]],[4,3,2,3,0,0,1],[4,3,0,3,1,3,[4]],[[2,3],0,1,4,0,0,1],[[2,2],4,[3],0,4,4,0],[2,0,0,0,[[2]],0,[[3]]],[[0,2],0,0,3,[2],2,0],[3,0,0,2,[4],0,[2]],[3,2,2,0,4,0,[3]],[4,0,[2],0,4,2,2],[[2,2],0,0,0,2,0,4],[1,0,[4],2,2,3,3],[[[2],0],3,[1],0,[2],0,0]],
+"Headings: 6c. Heading chars in SOL context (leading newline 
break)":[[1],[4],[2],[[0,[2]]],[[0,2]],[3],0,[[0,3]],[[2,[4]]],[[3,1]],[[0,[3]]],[[4,0]],[[3,[3]]],[[0,1]],[[4,2]],[[2,0]],[[3,0]],[[2,[2]]],[[4,3]],[[0,4]]],
+"Headings: 6d. Heading chars in SOL context (with interspersed 
comments)":[[[3,4,3,0,2,2,0,2,2,3]],[[0,1,4,2,2,[3],0,2,4,0]],[[0,3,4,3,0,[2],0,0,4,3]],[3],[[0,0,0,2,0,4,4,0,4,0]],[[0,2,3,3,2,0,3,0,0,0]],[1],[[3,1,0,0,4,4,0,0,3,0]],[[0,2,2,0,2,3,0,0,0,0]],[[0,0,0,2,3,1,4,4,3,4]],[2],[[0,[2],0,4,2,[4],2,0,2,0]],[[0,[2],0,0,0,4,0,4,3,3]],[[3,1,0,3,3,[3],4,4,2,0]],[[2,3,2,2,2,3,0,0,3,0]],[[4,0,0,0,0,1,0,2,4,0]],[[0,0,0,0,4,1,2,0,4,4]],[[4,1,0,2,0,3,3,2,0,0]],[[4,4,0,3,0,4,0,3,0,0]],[4]],
 "Headings: 6d. Heading chars in SOL context (No escaping needed)":[],
-"Lists: 0. Outside 
nests":[[2,3,[4]],[[2],0,0],[4,3,[2]],[1,4,[2]],[[3],4,1],[2,0,3],[3,3,[3]],[[4],2,[2]],[2,0,[3]],[[4],0,0],[0,0,3],[4,3,[[2]]],[[[4]],0,0],[[2],0,3],[1,0,0],[0,0,1],[4,2,1],[2,3,[3]],[3,2,2],[[[2]],0,[1]]],
+"Lists: 0. Outside 
nests":[[2,3,[4,2]],[[2,0],0,[[2],0]],[4,3,[2,0]],[1,4,[2,0]],[[3,4],2,4],[2,0,3],[3,3,[3,0]],[[4,2],0,2],[2,0,[3,0]],[[4,0],0,[0,2]],[0,3,2],[4,3,[[2],4]],[[[4],0],0,[[4],0]],[[2,0],3,2],[1,0,0],[0,2,[4,4]],[4,2,1],[2,3,[3,4]],[3,2,2],[[[2],0],0,1]],
 "Lists: 1. Nested inside 
html":[[[[4]],0,[1],0,[3],0,0,3,[1],4,1,3,4,4,2],[1,2,[1],0,4,0,1,3,[2],0,1,2,1,4,2],[[1],0,0,0,[1],4,[4],0,[4],2,4,0,[[[3]]],0,[3]],[[4],3,[4],0,[[3]],0,4,0,[[4]],3,4,2,[[[2]]],0,3],[[[1]],3,2,0,[2],0,[4],3,4,4,3,0,1,4,1],[3,0,4,0,2,2,0,3,1,3,1,0,[3],2,[2]],[3,0,4,3,1,2,[[2]],0,[[[4]]],3,[[3]],0,[[1]],3,[[1]]],[1,0,4,0,[[[3]]],0,[3],2,[3],4,[[[3]]],0,[[1]],0,4],[0,0,1,3,1,2,1,0,1,0,4,0,1,4,[[[4]]]],[[[2]],3,3,0,3,0,3,0,[2],0,[2],2,4,2,[[[4]]]],[4,0,[[4]],0,3,4,[[4]],0,2,0,1,0,2,3,0],[4,0,2,0,[[[3]]],3,3,2,[[[2]]],0,[[2]],2,[[3]],0,[[[2]]]],[1,0,3,0,2,0,4,4,[4],3,3,0,2,4,3],[1,3,[[1]],4,1,4,4,0,4,3,4,2,1,4,[2]],[3,3,[[2]],0,[2],0,3,3,2,4,4,3,[2],4,2],[4,2,[1],2,[1],0,4,2,[2],0,3,3,[4],3,1],[[[[4]]],0,[[4]],0,2,3,0,0,[[[3]]],0,[3],2,[1],0,[4]],[1,4,1,4,[[2]],2,1,0,[[[2]]],0,[3],4,1,0,[[1]]],[4,3,[3],3,1,0,[[1]],0,[[3]],0,2,0,0,2,[[[2]]]],[0,0,[1],0,3,3,[[[2]]],3,[1],2,[[[2]]],0,4,2,[3]]],
 "Lists: 2. Inside definition 
lists":[[1,3,[[2]],0,4,4,1],[[4],0,[1],0,[[1],0,1],0,[3]],[4,0,[2],4,[[4],0,[3]],4,[3]],[4,3,2,0,[3,0,4],2,4],[[1],0,4,4,[[[2]],2,4],4,[[2]]],[[2],0,2,0,[[2],0,2],0,[[1]]],[4,4,[[2]],3,[4,2,4],0,[[[3]]]],[3,2,2,0,2,4,[3]],[1,0,[[4]],0,[[4],0,0],0,4],[[1],4,[3],3,3,0,[1]],[2,0,0,3,1,0,4],[[2],4,4,0,[4,0,1],0,2],[[[1]],4,[[4]],0,2,3,3],[3,2,[1],0,[[[2]],0,3],2,[2]],[4,3,[1],0,1,0,1],[4,2,1,2,[0,4,4],0,0],[2,2,[[[3]]],3,[3,4,3],2,[2]],[[3],0,[1],3,[[1],0,[2]],4,[4]],[3,0,[2],0,1,3,1],[1,3,[4],0,[0,4,0],0,4]],
 "Lists: 3. Only bullets at start of text should be 
escaped":[[2,4,2],[3,3,4],[[[3]],0,[4]],[3,4,2],[[[[2]]],0,2],[1,0,1],[2,0,[2]],[[[[2]]],3,1],[4,3,[[1,4,4]]],[[[4]],2,3],[[3],0,4],[3,3,[[3,0,4]]],[[[3]],0,2],[2,0,[[4,4,3]]],[4,2,[3]],[[1],3,[[[4],2,2]]],[[2],0,[1]],[[[[4]]],2,[[[4],0,0]]],[[4],4,[[[4],2,3]]],[4,0,[[4,2,3]]]],
 "Lists: 4. No escapes 
needed":[[0,0,[[2,0]],0,[3]],[2,2,4,2,2],[[4],2,[4],0,1],[2,0,[[[4],0]],4,4],[[[2]],4,4,0,[3]],[4,0,2,0,2],[0,4,3,0,2],[4,0,2,3,[4]],[4,2,[[0,2]],2,[2]],[[2],2,3,4,[3]],[[[2]],2,3,0,2],[3,4,[[[4],2]],4,[[1,0]]],[[4],0,[[[3],4]],0,4],[[[4]],3,3,0,[[[4],4]]],[0,4,[1],2,1],[4,4,[[2,4]],0,4],[0,2,0,0,4],[1,0,3,0,[[3,2]]],[[[3]],0,2,4,[[0,4]]],[3,2,4,0,4]],
 "Lists: 5. No unnecessary 
escapes":[[4,3,[1],4,[4],3,2,0,[[0,4,0]],0,4],[1,4,1,4,[3],0,[1],3,0,2,[3]],[2,2,[3],3,[4],4,[[3,[1]]],4,4,2,[2]],[[4],2,[2],0,1,2,4,4,[2],0,[[3,0,4]]],[[[0,2]],0,[[4,[1]]],3,2,4,2,0,2,0,3],[[4],0,3,2,3,0,1,0,4,3,[3]],[[[0,[1]]],3,[2],4,1,0,[[0,[[3]]]],3,[3],0,[1]],[[[0,3]],2,3,0,0,2,[1],0,[1],4,[3]],[3,3,1,0,[[0,4]],2,[2],4,3,0,1],[1,0,[1],0,4,0,[3],2,3,0,1],[[[0,1]],2,[2],3,3,4,[3],0,2,2,[[4,2,0]]],[[[0,[[2]]]],0,[2],0,2,0,[[0,4]],0,[[4,3,0]],0,4],[[1],0,3,4,[4],4,2,4,3,2,1],[[[0,[1]]],4,[2],4,2,3,[[3,1]],4,[3],4,1],[4,3,4,2,[[0,[2]]],0,[[2,[[3]]]],0,4,0,[1]],[[[2,[4]]],3,1,4,4,0,[1],3,4,0,1],[[[2,[1]]],2,0,0,2,2,[4],3,4,4,[[0,3,3]]],[4,2,[[3,2]],4,3,2,[3],4,[1],4,[[3,1,0]]],[2,2,[2],4,1,0,[4],0,[3],3,1],[[[4,3]],3,[3],4,2,0,[[3,3]],4,1,3,[4]]],
 "Lists: 6. Escape bullets in SOL 
position":[[3],[4],[[2,4]],[1],[2],[[2,[4]]],[[0,4]],0,[[3,3]],[[2,0]],[[2,3]],[[0,1]],[[0,[4]]],[[0,3]],[[4,2]],[[3,4]],[[2,1]],[[4,0]],[[4,[2]]],[[0,[2]]]],
-"Lists: 7. Escape bullets in a multi-line 
context":[[1],[2],0,[[[4]]],[[2]],[[1]],[3],[[4]],[[[2]]],[[3]],[4],[[[3]]]],
+"Lists: 7. Escape bullets in a multi-line 
context":[[1],[2],[[0,[3],4]],[[0,3,4]],[[0,0,2]],[[2,3,0]],[3],[[4,[4],0]],[[0,1,0]],[[0,0,4]],[[2,3,3]],[[3,[4],0]],[[3,3,2]],[[4,2,0]],[[2,2,0]],[[0,0,3]],[[0,[3],0]],[[4,4,0]],[4],[[3,0,0]]],
 "HRs: 1. Single 
line":[[2,[3],4,1,0,0,4],[1,4,0,2,0,0,4],[0,2,2,3,2,4,4],[0,4,0,0,0,0,4],[0,[2],3,0,2,4,0],[0,3,2,2,2,0,2],[0,3,0,3,4,1,4],[0,3,4,0,4,4,0],[0,2,0,2,0,4,0],[0,2,4,1,0,0,0],[0,[4],0,3,0,4,3],[1,[4],2,0,0,0,3],[3,3,0,3,4,0,2],[2,[2],4,4,2,2,0],[4,1,3,0,3,2,0],[0,0,0,0,0,4,0],[2,3,2,4,0,4,0],[1,1,0,4,4,0,2],[0,4,0,3,2,1,0],[0,1,4,0,3,2,0]],
 "Tables: 1a. Simple 
example":[[4],[3],[[[2]]],[2],0,[1],[[[3]]],[[[4]]],[[4]],[[3]],[[2]],[[1]]],
 "Tables: 1b. No escaping needed":[0,[2],[4],[3]],
@@ -1090,7 +1091,7 @@
 "Tables: 4b. Escape 
+":[[2],[[3,[1,4,[0,[4]],0]]],[[4,1]],[[3,1]],[[0,1]],[3],[4],[[2,4]],[[2,[[3,2],3,[4,4],0]]],[[3,[[2,4],0,2,4]]],[[3,4]],[[3,3]],[[3,[4,0,2,2]]],[[0,[2,0,3,0]]],[[0,[2,0,[0,4],3]]],[[0,3]],[[0,2]],[[0,[0,2,[3,3],3]]],[[2,3]],[[2,[[4,3],2,[0,[2]],3]]]],
 "Tables: 4c. No escaping 
needed":[[3],[[2,4]],[[3,[[4,3,4,[3]],0,[2,[4,0],0,1],0]]],[[4,4]],[[4,[4,2,2,3]]],[[4,[[3,0,2,0],2,4,3]]],[4],[2],[[0,3]],[[0,[[3,3,0,1],3,2,0]]],[[2,[[0,[4],0,3],2,3,0]]],[[0,[1,3,[0,2,4,[0,3]],0]]],[[3,2]],[1],[[0,2]],[[0,4]],[[2,3]],[[4,[2,2,4,4]]],[[0,[[0,4,0,1],0,3,3]]],[[4,[[0,3,0,[2]],4,2,0]]]],
 "Tables: 4d. No escaping 
needed":[[[2,[3,0]]],[[0,4]],[[0,[[1,0,0],4]]],[4],[2],[[3,[[[3],3,2],4]]],[[0,1]],[[4,[[0,4,[2]],3]]],[[2,[2,0]]],[3],[[4,[[[4],2,[4]],0]]],[[2,3]],[[4,3]],[[0,[[0,0,1],3]]],[[2,[1,0]]],[1],[[0,[3,0]]],[[2,[[0,4,2],0]]],[[0,[[1,2,2],2]]],[[2,1]]],
-"Links 1. Quote marks in link 
text":[[1],[[3]],[4],[[[3]]],[[[4]]],[[4]],[[[[3]]]],0,[[[[2]]]],[[2]],[2],[[1]],[3],[[[1]]],[[[[4]]]],[[[2]]]],
+"Links 1. Quote marks in link 
text":[[1],[[3]],[4],[[[3,[3]]]],[[[3,4]]],[[4]],[[[0,2]]],0,[[[0,1]]],[[2]],[2],[[[0,[2]]]],[[1]],[[[2,1]]],[[[4,3]]],[3],[[[3,0]]],[[[2,4]]],[[[3,2]]],[[[2,0]]]],
 "Links 2. WikiLinks: Escapes 
needed":[[2],[[[1],2,4,0,[4],4,4,2,3,0,[4],4,0,2,[[2]],4,1,4,[[2]]]],[4],[[2,3,4,0,[2],2,[4],3,[[2]],4,[1],4,2,0,[3],0,4,4,4]],[[[2],4,[3],0,3,0,[3],4,4,0,2,4,0,0,1,3,0,2,[4]]],[[0,0,3,0,0,4,0,3,1,3,4,2,[[4]],4,[1],0,2,0,[[3]]]],[[3,4,0,0,[2],0,2,0,2,0,[2],2,3,0,2,0,[3],2,[2]]],[1],[3],[[[[3]],0,[[3]],4,1,3,[[2]],0,0,2,4,0,3,2,[2],2,2,2,[4]]],[[[4],0,2,0,0,2,[[4]],3,0,4,0,0,4,2,[[4]],0,[2],3,1]],[[1,0,0,4,[2],4,3,0,[[2]],0,3,0,2,0,[2],3,3,0,3]],[[[3],3,4,0,3,3,1,2,0,0,4,2,[4],3,2,4,1,3,3]],[[2,0,2,0,2,4,0,3,[[4]],0,4,4,1,0,[3],0,[4],2,[2]]],[[0,0,[[3]],0,3,0,[2],0,[3],0,[[3]],4,0,0,3,4,[1],2,[2]]],[[[4],0,0,4,3,0,4,0,4,0,[3],0,[3],4,2,0,4,0,4]],[[[2],0,[[4]],0,3,0,1,2,0,2,2,2,[[3]],0,1,4,[2],3,[[4]]]],[[[4],0,[2],0,1,3,2,4,[[4]],0,4,0,[2],0,0,3,[[2]],4,2]],[[2,0,[[3]],3,1,4,[3],2,1,2,0,4,0,0,3,3,0,2,0]],[[4,0,2,0,4,0,3,0,1,2,4,4,[[2]],2,3,3,3,0,[4]]]],
 "Links 3. WikiLinks: No escapes 
needed":[[[[3],0,4]],[3],[4],[[[2],0,2]],[[4,4,[3]]],[1],[[0,3,4]],[[3,4,[2]]],[2],[[[2],0,3]],[[4,0,[3]]],[[3,0,2]],[[2,3,3]],[[[4],0,0]],[[0,2,2]],[[0,4,2]],[[[3],2,1]],[[0,4,1]],[[[3],4,0]],[[1,0,1]]],
 "Links 4. ExtLinks: Escapes 
needed":[[[0,3,2]],[[[1],0,[2]]],[[[1],2,[4]]],[[[[4]],0,3]],[4],[2],[1],[[4,0,[4]]],[[3,0,2]],[[[[2]],4,1]],[[0,4,1]],[[2,0,4]],[3],[[2,0,2]],[[[4],3,4]],[[4,4,[1]]],[[1,3,0]],[[3,2,1]],[[4,0,2]],[[2,0,1]]],
@@ -1099,9 +1100,9 @@
 "2. Link fragments separated by <i> and <b> 
tags":[[0,2,4],[3,0,[4,[3],0]],[[0,[4],2],0,[0,1,1]],[[4,[2],0],0,3],[[4,4,0],0,1],[2,0,[0,[4],4]],[4,2,1],[[3,3,2],2,1],[[0,2,2],3,[2,4,[2]]],[4,0,1],[[0,1,[2]],0,2],[2,2,2],[[2,0,1],2,2],[[3,3,[3]],4,2],[[4,1,[3]],0,2],[[0,2,0],0,2],[4,0,[4,[2],2]],[3,0,3],[[0,4,3],3,2],[[0,2,4],0,3]],
 "2. Link fragments inside <i> and <b>\n(FIXME: Escaping one or both of[[and ]] 
is also acceptable --\n this is one of the shortcomings of this 
format)":[[3,3,4],[4,0,2],[1,0,2],[2,0,3],[4,4,1],[[2,1],4,[0,1]],[1,0,0],[4,0,1],[[1,4],3,1],[1,0,3],[[4,[2]],4,3],[4,3,3],[1,4,4],[[0,4],4,[1,[4]]],[[[2],1],4,[2,1]],[3,0,[4,2]],[[3,[4]],4,[4,0]],[[2,[3]],0,[4,[4]]],[1,2,[4,1]],[[0,2],2,1]],
 "1. No unnecessary 
escapes":[[[2,[2]],0,2,0,[3,4],0,[0,4],0,[0,3,1]],[2,0,1,0,[3,1],0,1,0,[2,[2],0]],[[4,3],0,2,2,2,0,[3,3],3,[0,2,0]],[2,0,1,4,1,2,2,0,[4,[3],0]],[[0,4],0,[3,4],4,[0,2],4,[2,0],0,[0,3,[3]]],[[0,4],0,[4,2],0,3,2,[2,4],2,[3,[2],4]],[0,0,[0,[2]],0,1,3,3,3,2],[1,4,[0,3],3,[0,2],2,1,0,3],[2,0,2,4,1,2,0,4,[0,4,0]],[1,0,[0,1],4,[3,[[4]]],0,[4,4],2,3],[[0,[2]],0,2,0,[0,[[4]]],4,2,4,[0,0,3]],[[0,[3]],0,[3,0],3,2,4,[2,[1]],2,3],[[4,1],0,[0,2],3,2,0,[3,4],0,4],[4,4,3,3,3,2,[0,[4]],0,[0,1,4]],[4,2,[4,0],4,[0,3],3,[0,4],0,[0,[2],0]],[3,3,[0,4],4,3,3,3,0,[0,2,0]],[2,0,4,2,[0,3],0,1,0,[0,4,[3]]],[1,0,[0,3],3,[0,[[4]]],0,3,2,[2,[3],4]],[3,2,[0,3],0,[3,[4]],2,4,0,4],[[3,4],0,[2,4],2,[4,[4]],3,[0,4],3,[3,3,[4]]]],
-"1. Leading whitespace in SOL context should be 
escaped":[[3,0,[4],2,3,4,3,0,1,4,1,0,4],[2,0,[[2]],4,3,3,[1,0,0,2,[4]],0,1,4,[[4]],0,1],[[1],3,4,3,2,0,[2,3,0,0,3],2,[[4]],2,[4],0,4],[[2],3,4,3,[3],3,[1,0,2,3,1],2,2,0,1,0,2],[3,2,3,0,[2],3,[0,0,3,0,2],0,[[4]],0,3,4,2],[[[4]],0,[1],0,2,0,[1,3,0,0,3],0,0,4,0,0,[2]],[[3],0,0,2,1,0,[[4],4,2,2,3],0,0,4,4,0,[1]],[[4],0,4,2,[[2]],0,[[3],0,4,2,[4]],3,[[3]],3,3,0,0],[3,0,[[4]],2,4,0,2,0,1,0,[[2]],0,0],[1,0,4,0,4,3,1,3,4,2,[3],3,2],[[1],3,[[4]],2,3,2,4,0,2,0,2,2,[4]],[4,0,[2],4,[1],0,[1,0,4,2,0],0,3,0,1,0,[1]],[[3],2,[4],0,0,0,3,4,4,0,3,0,2],[4,2,3,4,4,0,[0,0,0,2,4],3,0,0,0,4,0],[2,0,1,0,[1],0,[2,4,4,0,0],0,3,4,[[3]],3,1],[[[4]],2,[[3]],3,[[3]],0,[[2],2,2,0,[4]],2,1,0,0,0,[1]],[[3],0,[3],0,[1],0,[4,4,3,3,3],0,4,0,2,0,[3]],[0,3,2,0,0,0,[[2],4,0,0,3],2,4,4,4,0,[4]],[[4],2,[3],4,[[3]],0,[4,3,0,4,1],0,2,0,1,0,[[4]]],[1,3,[3],2,1,3,[[3],0,0,0,4],0,[2],0,0,0,4]],
+"1. Leading whitespace in SOL context should be 
escaped":[[3,0,[4,2],3,4,3,[1,4,2,0,4,0],0,[0,[2],2],0,[0,4,4],0,3],[2,0,[[2],4],3,3,0,1,0,[2,[4],0],2,4,0,[4,[2],0]],[[1,3],4,2,3,[[3],3],0,[3,2,0,0,4,2],0,4,0,4,0,[0,[2],2]],[[2,3],4,2,0,3,3,[1,0,2,3,1,2],3,[2,[3],4],2,[0,2,0],0,[0,[2],4]],[3,2,3,0,[2,3],0,[0,3,0,3,0,0],4,[3,4,3],2,1,0,[0,1,0]],[[[4],0],0,1,0,2,0,[1,3,0,0,3,0],0,[0,4,0],0,[0,[3],2],0,4],[[3,0],0,[[2],2],0,[[4],4],2,1,3,[0,0,4],4,[0,1,4],0,[0,1,3]],[[4,0],4,1,0,[1,0],0,[3,0,4,2,[4],3],0,[3,3,3],0,[0,0,3],0,1],[3,0,[[4],2],4,[2,0],2,[0,2,0,0,0,0],0,3,3,4,4,[3,3,0]],[1,0,4,0,4,3,1,3,4,2,[3,3,3],0,1],[[1,3],0,[4,2],3,2,4,[2,0,3,2,[4],0],0,2,4,[3,0,2],2,1],[4,0,[2,4],0,1,0,[1,0,4,2,0,0],4,[2,0,2],4,1,4,[0,0,4]],[[3,2],0,4,0,0,4,3,4,[3,[3],2],2,2,0,[2,[4],2]],[4,2,3,4,4,0,[0,0,0,2,4,3],0,0,0,4,0,[0,3,0]],[2,0,1,0,[1,0],0,2,4,3,0,[0,[3],4],0,[3,3,2]],[[[4],2],0,[2,3],0,[2,0],0,[1,2,2,0,[4],2],2,0,0,1,0,[3,4,0]],[[3,0],0,3,0,[1,0],0,4,4,3,3,3,0,4],[[0,3],3,0,0,[[2],4],0,[3,2,4,4,4,0],0,4,0,[0,[2],4],0,[0,3,0]],[[4,2],0,3,4,[[3],0],0,4,3,[4,1,0],3,[2,0,0],4,[2,0,0]],[1,3,[3,2],2,2,0,[3,0,0,0,4,0],0,2,0,[0,0,4],3,3]],
 "1. a tags":[[3],[1],[4],[[4]],0,[2],[[3]],[[2]]],
-"2. other 
tags":[[3],[[2]],[[[4]]],[4],[1],0,[2],[[3]],[[[3]]],[[1]],[[[2]]],[[4]]],
+"2. other 
tags":[[3],[[2,3,3]],[[[4],0,[3]]],[4],[1],[[0,4,2]],[[2,0,0]],[[0,0,3]],[2],[[1,0,3]],[[3,4,1]],[[0,4,[4]]],[[2,0,3]],[[[2],2,3]],[[2,4,2]],[[[4],4,[2]]],[[0,0,[3]]],[[4,0,3]],0,[[3,0,[2]]]],
 "3. multi-line html 
tag":[[[[2]]],[[[3]]],[[[4]]],[2],[1],0,[[4]],[3],[[3]],[[1]],[4],[[2]]],
 "4. extension 
tags":[0,[2],[[[4]]],[[4]],[[[3]]],[[3]],[1],[[[2]]],[4],[3],[[2]],[[1]]],
 "Escaping 
nowikis":[[[1,0,0,2,0,4,[4]]],[[3,0,0,0,3,2,0]],[4],[1],[[0,2,1,0,2,4,0]],[[1,3,1,0,0,0,[2]]],[[4,3,4,0,0,2,4]],[2],[[0,2,0,3,[4],0,3]],[[0,0,2,0,4,0,0]],[[0,0,0,4,4,0,0]],[3],[[[3],0,0,0,1,0,[3]]],[[0,4,0,0,1,4,4]],[[1,0,1,0,3,2,1]],[[3,0,4,0,[4],0,3]],[[4,0,[4],0,0,4,0]],[[0,4,4,0,2,0,0]],[[0,0,3,4,1,0,[4]]],[[2,4,[2],0,1,4,0]]],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1048faad788ec89a196660ad7f29756dcdff672d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>

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

Reply via email to