From bf3a2fd2b7d0458606b25a5321893834866cf284 Mon Sep 17 00:00:00 2001 From: Subramanya Sastry Date: Thu, 24 May 2018 12:16:15 -0500 Subject: [PATCH] Minimize whitespace dirty diffs in existing headings, tables, lists * For existing and edited headings, tables, lists, this patch examines the original source for the node and where there is leading/trailing whitespace, adds back at most 1 whitespace char. * So, this doesn't preserve all whitespace or avoid all normalization. * this doesn't look for comments or other rendering transparent nodes. * this doesn't try to preserve multiple whitespace characters * this doesn't try to preserve trailing whitepace for a / that is the last element in a wikitext line. * The blacklist changes are all improvements. Bug: T195486 Change-Id: Ib571806a765e7306e1dbbf26c293998030aff0c1 --- lib/html2wt/DOMHandlers.js | 85 +++++++++++++++++++++--------- lib/utils/Util.js | 7 +-- tests/citeParserTests-blacklist.js | 14 ++--- tests/parserTests-blacklist.js | 72 +++++++++++++++---------- tests/parserTests.txt | 4 +- 5 files changed, 116 insertions(+), 66 deletions(-) diff --git a/lib/html2wt/DOMHandlers.js b/lib/html2wt/DOMHandlers.js index 04868239b..4dee7b3b6 100644 --- a/lib/html2wt/DOMHandlers.js +++ b/lib/html2wt/DOMHandlers.js @@ -60,6 +60,52 @@ function isRecognizedSpanWrapper(type) { }) !== undefined; } +function getLeadingSpace(state, node, newEltDefault, fc) { + let space = ''; + if (DU.isNewElt(node)) { + if (!fc) { + fc = node.firstChild; + } + if (fc && (!DU.isText(fc) || !fc.nodeValue.match(/^\s/))) { + space = newEltDefault; + } + } else if (state.selserMode) { + const dsr = DU.getDataParsoid(node).dsr; + if (Util.isValidDSR(dsr, true)) { + const offset = dsr[0] + dsr[2]; + space = offset < (dsr[1] - dsr[3]) ? state.getOrigSrc(offset, offset + 1) : ''; + if (!/[ \t]/.test(space)) { + space = ''; + } + } + } + return space; +} + +function getTrailingSpace(state, node, newEltDefault) { + let space = ''; + if (DU.isNewElt(node)) { + const lc = node.lastChild; + if (lc && (!DU.isText(lc) || !lc.nodeValue.match(/\s$/))) { + space = newEltDefault; + } + } else if (state.selserMode) { + const dsr = DU.getDataParsoid(node).dsr; + if (Util.isValidDSR(dsr, true)) { + const offset = dsr[1] - dsr[3] - 1; + // The > instead of >= is to deal with an edge case + // = = where that single space is captured by the + // getLeadingSpace case above + space = offset > (dsr[0] + dsr[2]) ? state.getOrigSrc(offset, offset + 1) : ''; + if (!/[ \t]/.test(space)) { + space = ''; + } + } + } + + return space; +} + function buildHeadingHandler(headingWT) { return { forceSOL: true, @@ -69,14 +115,10 @@ function buildHeadingHandler(headingWT) { // Skip fallback ID if present. fc = fc.nextSibling; } + // For new elements, for prettier wikitext serialization, // emit a space after the last '=' char. - var space = ''; - if (DU.isNewElt(node)) { - if (fc && (!DU.isText(fc) || !fc.nodeValue.match(/^\s/))) { - space = ' '; - } - } + let space = getLeadingSpace(state, node, ' ', fc); state.emitChunk(headingWT + space, node); state.singleLineContext.enforce(); @@ -89,13 +131,7 @@ function buildHeadingHandler(headingWT) { // For new elements, for prettier wikitext serialization, // emit a space before the first '=' char. - space = ''; - if (DU.isNewElt(node)) { - var lc = node.lastChild; - if (lc && (!DU.isText(lc) || !lc.nodeValue.match(/\s$/))) { - space = ' '; - } - } + space = getTrailingSpace(state, node, ' '); state.emitChunk(space + headingWT, node); state.singleLineContext.pop(); }), @@ -138,13 +174,7 @@ function getListBullets(state, node) { // For new elements, for prettier wikitext serialization, // emit a space after the last bullet (if required) - var space = ''; - if (DU.isNewElt(node)) { - var fc = node.firstChild; - if (fc && (!DU.isText(fc) || !fc.nodeValue.match(/^\s/))) { - space = ' '; - } - } + var space = getLeadingSpace(state, node, ' '); var dp, nodeName, parentName; var res = ''; @@ -794,12 +824,13 @@ var tagHandlers = JSUtils.mapObject({ .replace(/{{!}}{{!}}/, '{{!}}'); } + const thTag = yield serializeTableTag(startTagSrc, attrSepSrc, state, node, wrapperUnmodified); + const inWideTH = /!!|\|\||^{{!}}{{!}}/.test(thTag); + const trailingSpace = inWideTH ? getTrailingSpace(state, DU.previousNonDeletedSibling(node), '') : ''; + const leadingSpace = getLeadingSpace(state, node, ''); // If the HTML for the first th is not enclosed in a tr-tag, // we start a new line. If not, tr will have taken care of it. - WTSUtils.emitStartTag( - yield serializeTableTag( - startTagSrc, attrSepSrc, state, node, wrapperUnmodified - ), + WTSUtils.emitStartTag(trailingSpace + thTag + leadingSpace, node, state ); @@ -862,8 +893,10 @@ var tagHandlers = JSUtils.mapObject({ startTagSrc, attrSepSrc, state, node, wrapperUnmodified ); - var inWideTD = (tdTag.length > 1); - WTSUtils.emitStartTag(tdTag, node, state); + var inWideTD = /\|\||^{{!}}{{!}}/.test(tdTag); + const trailingSpace = inWideTD ? getTrailingSpace(state, DU.previousNonDeletedSibling(node), '') : ''; + const leadingSpace = getLeadingSpace(state, node, ''); + WTSUtils.emitStartTag(trailingSpace + tdTag + leadingSpace, node, state); var tdHandler = state.serializer.wteHandlers.tdHandler .bind(state.serializer.wteHandlers, node, inWideTD); diff --git a/lib/utils/Util.js b/lib/utils/Util.js index 21e7b1b98..2eb557b97 100644 --- a/lib/utils/Util.js +++ b/lib/utils/Util.js @@ -1350,10 +1350,11 @@ var Util = { (cp >= 0x10000 && cp <= 0x10ffff); }, - isValidDSR: function(dsr) { + isValidDSR: function(dsr, all) { + const isValidOffset = n => typeof (n) === 'number' && n >= 0; return dsr && - typeof (dsr[0]) === 'number' && dsr[0] >= 0 && - typeof (dsr[1]) === 'number' && dsr[1] >= 0; + isValidOffset(dsr[0]) && isValidOffset(dsr[1]) && + (!all || (isValidOffset(dsr[2]) && isValidOffset(dsr[3]))); }, /** diff --git a/tests/citeParserTests-blacklist.js b/tests/citeParserTests-blacklist.js index 18fb7d04c..d1e20dc24 100644 --- a/tests/citeParserTests-blacklist.js +++ b/tests/citeParserTests-blacklist.js @@ -631,22 +631,24 @@ add("selser", " with a non-empty name parameter and no content. [3,4,0]", " add("selser", " with a non-empty name parameter and no content. [[2,0],3,0]", "1fli58lBla."); add("selser", " with a non-empty name parameter and no content. [[2,0],0,0]", "v0qv1iBla.\n"); add("selser", "s with the follow parameter [[3,0],0,0,4,3,0,0]", "First page footnote text.\n\nPage two.Second page footnote text.\n\nxqyalt\n"); +add("selser", "s with the follow parameter [1,4,[4,0],2,[3],0,0]", "Page one.First page footnote text.\n\n9ki6l7\n\n1hjif86Second page footnote text.\n\n1i0negw\n\n== ==\n"); add("selser", "s with the follow parameter [0,4,4,2,0,0,0]", "Page one.First page footnote text.\n\n29j6zc\n\n1x9odrq\n\nv7xh68\n\n== References ==\n"); add("selser", "s with the follow parameter [2,2,4,2,0,0,0]", "1dnzkqa\n\nPage one.First page footnote text.\n\nuon3pk\n\n1dbvwk9\n\n21rzyo\n\n== References ==\n"); add("selser", "s with the follow parameter [1,3,0,0,4,3,0]", "Page one.First page footnote text.\n\nPage two.Second page footnote text.\n\nhqrwbi"); -add("selser", "s with the follow parameter [[3,0],0,0,2,[2],0,0]", "First page footnote text.\n\nPage two.Second page footnote text.\n\nwfd1vh\n\n==new02fReferences==\n"); +add("selser", "s with the follow parameter [[3,0],0,0,2,[2],0,0]", "First page footnote text.\n\nPage two.Second page footnote text.\n\nwfd1vh\n\n== new02fReferences ==\n"); add("selser", "s with the follow parameter [4,0,3,2,2,2,0]", "1sz2kwi\n\n1u5by29\n\nchwdfu\n\n== References ==\nhr0bxe\n"); add("selser", "s with the follow parameter [3,2,4,4,2,0,0]", "1fr2f18\n\n1dsi9l4\n\n1tfqpin\n\njnye6h\n\n== References ==\n"); add("selser", "s with the follow parameter [0,0,1,3,0,0,0]", "Page one.First page footnote text.\n\nPage two.Second page footnote text.\n== References ==\n"); add("selser", "s with the follow parameter [[4,0],3,3,3,0,0,0]", "dd3s01First page footnote text.\n== References ==\n"); -add("selser", "s with the follow parameter [0,4,0,4,[2],3,0]", "Page one.First page footnote text.\n\ndht9ly\n\nPage two.Second page footnote text.\n\n1ijup9y\n\n==zd10unReferences==\n"); -add("selser", "s with the follow parameter [3,0,2,0,[3],2,0]", "\n1bjaryq\n\nPage two.Second page footnote text.\n\n====\n13mp93f\n"); +add("selser", "s with the follow parameter [0,4,0,4,[2],3,0]", "Page one.First page footnote text.\n\ndht9ly\n\nPage two.Second page footnote text.\n\n1ijup9y\n\n== zd10unReferences ==\n"); +add("selser", "s with the follow parameter [3,0,2,0,[3],2,0]", "\n1bjaryq\n\nPage two.Second page footnote text.\n\n== ==\n13mp93f\n"); add("selser", "s with the follow parameter [0,4,[3,0],3,0,0,0]", "Page one.First page footnote text.\n\nb1xm6f\n\nSecond page footnote text.\n\n== References ==\n"); -add("selser", "s with the follow parameter [4,4,0,3,[3],0,0]", "1e4je6d\n\n1ngk4kr\n\nPage two.Second page footnote text.\n====\n"); +add("selser", "s with the follow parameter [4,4,1,3,1,2,0]", "1aekhrn\n\n1nsg78m\n\nPage two.Second page footnote text.\n== References ==\n10esws3\n"); +add("selser", "s with the follow parameter [4,4,0,3,[3],0,0]", "1e4je6d\n\n1ngk4kr\n\nPage two.Second page footnote text.\n== ==\n"); add("selser", "s with the follow parameter [2,3,0,0,2,0,0]", "1w76sli\n\nPage one.First page footnote text.\n\nPage two.Second page footnote text.\n\nlzh28u\n\n== References ==\n"); add("selser", "s with the follow parameter [0,0,0,4,3,0,0]", "Page one.First page footnote text.\n\nPage two.Second page footnote text.\n\nnc6mwu\n"); -add("selser", "s with the follow parameter [1,0,1,0,1,0,0]", "Page one.First page footnote text.\n\nPage two.Second page footnote text.\n\n==References==\n"); -add("selser", "s with the follow parameter [3,4,[4,0],0,[4],0,0]", "1pnw6s5\n\n18wphooSecond page footnote text.\n\n==1egt7au==\n"); +add("selser", "s with the follow parameter [1,0,1,0,1,0,0]", "Page one.First page footnote text.\n\nPage two.Second page footnote text.\n\n== References ==\n"); +add("selser", "s with the follow parameter [3,4,[4,0],0,[4],0,0]", "1pnw6s5\n\n18wphooSecond page footnote text.\n\n== 1egt7au ==\n"); add("selser", " with both name and follow parameters - invalid [[2,0],2,0]", "7g93afPage one.This ref is invalid.\n\nv9fx2h\n"); add("selser", " with both name and follow parameters - invalid [[4,0],3,0]", "jf0w9cThis ref is invalid."); add("selser", " with both name and follow parameters - invalid [1,0,0]", "Page one.This ref is invalid.\n"); diff --git a/tests/parserTests-blacklist.js b/tests/parserTests-blacklist.js index 2fc429e60..842698cd6 100644 --- a/tests/parserTests-blacklist.js +++ b/tests/parserTests-blacklist.js @@ -1277,12 +1277,16 @@ add("selser", "Accept \"| !\" at start of line in tables (ignore !-attribute) [[ add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[4,[[0,0,4,3],4,[2,4,[2],[3],2,[3],[2],1],3,4,0]]]", "{|\n|-\n|style='color:red;'|+1\n|je9a5x\n|-\n|1es89nf\n|lrqhh8||1vdyqyt2||\n|kmqcrp\n| ||13gkdkf+2|| data-foobar=\"zh3ts2\" |-3\n|}"); add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [1]", "{| data-foobar=\"1gl68m8\"\n|-\n|style='color:red;'|+1\n|style='color:blue;'|-1\n|-\n|1||2||3\n|1||+2||-3\n|-\n| +1\n| -1\n|}"); add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [2]", "1e44vh7\n{|\n|-\n|style='color:red;'|+1\n|style='color:blue;'|-1\n|-\n|1||2||3\n|1||+2||-3\n|-\n| +1\n| -1\n|}"); -add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[0,[3,2,3,4,[4,2,4,1],3]]]", "{|\n\n|-\n|c2jpvx\n|yz5svz\n| +1\n|qfcae5\n| data-foobar=\"17jwauo\" |-1\n|}"); +add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[2,1]]", "{|\n|-\n| style=\"color:red;\" |+1\n| style=\"color:blue;\" |-1\n|-\n|1||2||3\n|1||+2||-3\n|-\n| +1\n| -1\n|}"); +add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[0,[3,2,3,4,[4,2,4,1],3]]]", "{|\n\n|-\n|c2jpvx\n|yz5svz\n| +1\n|qfcae5\n| data-foobar=\"17jwauo\" | -1\n|}"); add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[0,1]]", "{|\n|-\n|style='color:red;'|+1\n|style='color:blue;'|-1\n|-\n|1||2||3\n|1||+2||-3\n|-\n| +1\n| -1\n|}"); +add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[2,[[0,4,0,[4]],0,1,2,[0,2,4,[2]],0]]]", "{|\n|-\n|a8wi7q\n| style=\"color:blue;\" |1f9m22c\n|- data-foobar=\"3r29hf\"\n|1||2||3\n|1||+2||-3\n|-\n|5d67fn\n| +1\n|htjcvv\n| 1aet3tv-1\n|}"); add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[0,2]]", "{|\n|-\n|style='color:red;'|+1\n|style='color:blue;'|-1\n|-\n|1||2||3\n|1||+2||-3\n|-\n| +1\n| -1\n|}"); add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[0,[3,2,[4,4,3,2,0,1,0,2],3,[4,0,4,0],0]]]", "{|\n\n|-\n|16z60jx\n|x9ppxd\n|r51bry||3\n| data-foobar=\"1kz8mk6\" |1||+2\n|p5fw51||-3\n|-\n|1t94ye7\n| +1\n|125d88b\n| -1\n|}"); add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[3,[[3,1,0,[4]],3,4,2,[0,4,0,0],4]]]", "{|\n|-\n| style=\"color:red;\" data-foobar=\"p348lc\" |+1\n|style='color:blue;'|k4tdu0\n|-\n|hdvifu\n| -1\n|}"); -add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[0,[[3,2,0,0],0,[2,0,1,[2],0,0,0,2],0,[0,[4],0,0],0]]]", "{|\n|-\n|miw69\n|style='color:red;'|+1\n|style='color:blue;'|-1\n|-\n|1l3081g\n|1|| data-foobar=\"4dp8jk\" |2||17cpoo03\n|1||+2\n|xy04h0||-3\n|-\n|14bux0j\n| -1\n|}"); +add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[0,[[3,2,0,0],0,[2,0,1,[2],0,0,0,2],0,[0,[4],0,0],0]]]", "{|\n|-\n|miw69\n|style='color:red;'|+1\n|style='color:blue;'|-1\n|-\n|1l3081g\n|1|| data-foobar=\"4dp8jk\" |2||17cpoo03\n|1||+2\n|xy04h0||-3\n|-\n| 14bux0j\n| -1\n|}"); +add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[2,[3,0,3,2,1,2]]]", "{|\n\n\n|- data-foobar=\"1s9g24y\"\n| +1\n| -1\n|}"); +add("selser", "Allow +/- in 2nd and later cells in a row, in 1st cell when td-attrs are present, or in 1st cell when there is a space between \"|\" and +/- [[2,[[3,[2],4,3],2,[4,2,0,0,2,3,4,2],0,2,0]]]", "{|\n|-\n| style=\"color:red;\" |1e1o29t+1\n|1bf63c3\n|-\n|s8pkt\n|173pq5u\n|1||2||3\n|gncoa2\n|3ehrw7\n|12uqmez||-3\n|-\n| +1\n| -1\n|}"); add("selser", "Table rowspan [[3,2]]", "{| border=1\n|Cell 1, row 1\n|rowspan=2|Cell 2, row 1 (and 2)\n|Cell 3, row 1\n|-\n|Cell 1, row 2\n|Cell 3, row 2\n|}"); add("selser", "Table rowspan [[0,1]]", "{| border=1\n|Cell 1, row 1\n|rowspan=2|Cell 2, row 1 (and 2)\n|Cell 3, row 1\n|-\n|Cell 1, row 2\n|Cell 3, row 2\n|}"); add("selser", "Table rowspan [[2,[[2,0,3,0,4],0,[0,0,0,3],2]]]", "{| border=1\n|8xt6hw\n|Cell 1, row 1\n|1hnzall\n|-\n|Cell 1, row 2\n\n|}"); @@ -1310,12 +1314,12 @@ add("selser", "Nested table [[2,3]]", "{| border=1\n|}"); add("selser", "Nested table [[4,1]]", "{| border=1\n| α\n|\n{| bgcolor=#ABCDEF border=2\n|nested\n|-\n|table\n|}\n|the original table again\n|}"); add("selser", "Nested table [1]", "{| border=\"1\" data-foobar=\"1x647n6\"\n| α\n|\n{| bgcolor=#ABCDEF border=2\n|nested\n|-\n|table\n|}\n|the original table again\n|}"); add("selser", "Nested table [[3,2]]", "{| border=1\n| α\n|\n{| bgcolor=#ABCDEF border=2\n|nested\n|-\n|table\n|}\n|the original table again\n|}"); -add("selser", "Nested table [[2,1]]", "{| border=1\n|α\n|\n{| bgcolor=\"#ABCDEF\" border=\"2\"\n|nested\n|-\n|table\n|}\n|the original table again\n|}"); +add("selser", "Nested table [[2,1]]", "{| border=1\n| α\n|\n{| bgcolor=\"#ABCDEF\" border=\"2\"\n|nested\n|-\n|table\n|}\n|the original table again\n|}"); add("selser", "Nested table [[3,[3,0]]]", "{| border=1\n|}"); add("selser", "Nested table [[0,[[0,4,[4,1],2,2],0]]]", "{| border=1\n| α\n|1aokhi5\n|14zv42q\n{| bgcolor=\"#ABCDEF\" border=\"2\" data-foobar=\"p6svuj\"\n|nested\n|-\n|table\n|}\n|yd3jrc\n|kfkyff\n|the original table again\n|}"); add("selser", "Nested table [[3,[1,4]]]", "{| border=1\n| α\n|\n{| bgcolor=#ABCDEF border=2\n|nested\n|-\n|table\n|}\n|the original table again\n|}"); add("selser", "Nested table [[0,4]]", "{| border=1\n|}"); -add("selser", "Nested table [[0,[[1,2,[3,4],0,4],2]]]", "{| border=1\n| data-foobar=\"1j0u5p5\" | α\n|yn4ogm\n|1auu2z2\n|1wca08l\n|}"); +add("selser", "Nested table [[0,[[1,2,[3,4],0,4],2]]]", "{| border=1\n| data-foobar=\"1j0u5p5\" | α\n|yn4ogm\n|1auu2z2\n|1wca08l\n|}"); add("selser", "Nested table [[0,[1,2]]]", "{| border=1\n| α\n|\n{| bgcolor=#ABCDEF border=2\n|nested\n|-\n|table\n|}\n|the original table again\n|}"); add("selser", "Nested table [[0,1]]", "{| border=1\n| α\n|\n{| bgcolor=#ABCDEF border=2\n|nested\n|-\n|table\n|}\n|the original table again\n|}"); add("selser", "Nested table [[0,[[2,0,[4,[0,[0,0,[0,3],2]]],0,0],4]]]", "{| border=1\n|4n52hy\n| α\n|1pd7ii1\n{| bgcolor=#ABCDEF border=2\n|nested\n|-\n\n|}\n|the original table again\n|}"); @@ -1338,16 +1342,16 @@ add("selser", "Table cell attributes: Pipes protected by nowikis should be treat add("selser", "Table cell attributes: Pipes protected by nowikis should be treated as a plain character [[0,[[4,0,[2],3,2],0]]]", "{|\n|112jznj\n|title=\"foo|\" |1avq90lbar\n|1brje4y\n|title=\"foo|\" bar\n|}"); add("selser", "Table cell attributes: Pipes protected by nowikis should be treated as a plain character [[3,[[[2],4,[3],3,1],0]]]", "{|\n|title=\"foo\" |1ks7hu2bar\n|6n8px6\n| title=\"foo|\" |\n| data-foobar=\"18ta8cl\" |title=\"foo|\" bar\n|}"); add("selser", "Element attributes with double ! should not be broken up by [[3,[[[0,4,0]],0]]]", "{|\n!hi \nrgsfem\n ho\n|}"); -add("selser", "Invalid text in table attributes should be preserved by selective serializer [[3,[[[2],2,[2]],4]]]", "{| boo style='border:1px solid black'\n| boo style='color:blue' |erkdht1\n|1pjart5\n| style=\"color:blue\" boo |12g0bj42\n|}"); +add("selser", "Invalid text in table attributes should be preserved by selective serializer [[3,[[[2],2,[2]],4]]]", "{| boo style='border:1px solid black'\n| boo style='color:blue' | erkdht1\n|1pjart5\n| style=\"color:blue\" boo | 12g0bj42\n|}"); add("selser", "Invalid text in table attributes should be preserved by selective serializer [[0,4]]", "{| boo style='border:1px solid black'\n|}"); add("selser", "Invalid text in table attributes should be preserved by selective serializer [1]", "{| style=\"border:1px solid black\" data-foobar=\"12li3bp\" boo\n| boo style='color:blue' | 1\n|boo style='color:blue'| 2\n|}"); add("selser", "Invalid text in table attributes should be preserved by selective serializer [[2,3]]", "{| boo style='border:1px solid black'\n|}"); -add("selser", "Invalid text in table attributes should be preserved by selective serializer [[4,[[1,0,[3]],2]]]", "{| boo style='border:1px solid black'\n| style=\"color:blue\" data-foobar=\"1tzva8q\" boo |1\n|boo style='color:blue'|\n|}"); +add("selser", "Invalid text in table attributes should be preserved by selective serializer [[4,[[1,0,[3]],2]]]", "{| boo style='border:1px solid black'\n| style=\"color:blue\" data-foobar=\"1tzva8q\" boo | 1\n|boo style='color:blue'| \n|}"); add("selser", "Invalid text in table attributes should be preserved by selective serializer [[2,[3,0]]]", "{| boo style='border:1px solid black'\n\n|}"); add("selser", "Invalid text in table attributes should be preserved by selective serializer [[0,[1,0]]]", "{| boo style='border:1px solid black'\n| boo style='color:blue' | 1\n|boo style='color:blue'| 2\n|}"); add("selser", "Invalid text in table attributes should be preserved by selective serializer [[0,1]]", "{| boo style='border:1px solid black'\n| boo style='color:blue' | 1\n|boo style='color:blue'| 2\n|}"); add("selser", "Invalid text in table attributes should be preserved by selective serializer [2]", "1q63vep\n{| boo style='border:1px solid black'\n| boo style='color:blue' | 1\n|boo style='color:blue'| 2\n|}"); -add("selser", "Invalid text in table attributes should be preserved by selective serializer [[2,[[3,0,2],0]]]", "{| boo style='border:1px solid black'\n|12327is\n| style=\"color:blue\" boo |2\n|}"); +add("selser", "Invalid text in table attributes should be preserved by selective serializer [[2,[[3,0,2],0]]]", "{| boo style='border:1px solid black'\n|12327is\n| style=\"color:blue\" boo | 2\n|}"); add("selser", "Invalid text in table attributes should be preserved by selective serializer [[0,3]]", "{| boo style='border:1px solid black'\n|}"); add("selser", "Invalid text in table attributes should be preserved by selective serializer [[4,4]]", "{| boo style='border:1px solid black'\n|}"); add("selser", "Invalid text in table attributes should be preserved by selective serializer [[4,3]]", "{| boo style='border:1px solid black'\n|}"); @@ -1364,15 +1368,20 @@ add("selser", "Build table with {{!}} [[4,2]]", "{{{!}} class=\"wikitable\"\n!header\n!second header\n{{!}}- style=\"color:red;\"\n{{!}}data{{!}}{{!}} style=\"color:red;\" {{!}}second data\n{{!}}}"); add("selser", "Build table with {{!}} [[4,1]]", "{{{!}} class=\"wikitable\"\n!header\n!second header\n{{!}}- style=\"color:red;\"\n{{!}}data{{!}}{{!}} style=\"color:red;\" {{!}}second data\n{{!}}}"); add("selser", "Build table with {{!}} [[3,1]]", "{{{!}} class=\"wikitable\"\n!header\n!second header\n{{!}}- style=\"color:red;\"\n{{!}}data{{!}}{{!}} style=\"color:red;\" {{!}}second data\n{{!}}}"); -add("selser", "Build table with pipe as data [[4,[[[3],4,[2]],4,1,3,1,0,[2,[3],0],3]]]", "{| class=\"wikitable\"\n!\n!d7701x\n!1tbn79zsecond header\n|- style=\"color:red;\" data-foobar=\"r8fxpk\"\n|data|| style=\"color:red;\" |second data\n|- data-foobar=\"uclhfr\"\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n|5k1hnz\n|| |||second data with |\n|}"); +add("selser", "Build table with pipe as data [[4,[[[3],4,[2]],4,1,3,1,0,[2,[3],0],3]]]", "{| class=\"wikitable\"\n!\n!d7701x\n!1tbn79zsecond header\n|- style=\"color:red;\" data-foobar=\"r8fxpk\"\n|data|| style=\"color:red;\" |second data\n|- data-foobar=\"uclhfr\"\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n|5k1hnz\n|| |||second data with |\n|}"); add("selser", "Build table with pipe as data [[4,2]]", "{| class=\"wikitable\"\n!header\n!second header\n|- style=\"color:red;\"\n|data|| style=\"color:red;\" |second data\n|-\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n||data with | |||second data with |\n|}"); add("selser", "Build table with pipe as data [[3,2]]", "{| class=\"wikitable\"\n!header\n!second header\n|- style=\"color:red;\"\n|data|| style=\"color:red;\" |second data\n|-\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n||data with | |||second data with |\n|}"); add("selser", "Build table with pipe as data [2]", "16o0w77\n{| class=\"wikitable\"\n!header\n!second header\n|- style=\"color:red;\"\n|data|| style=\"color:red;\" |second data\n|-\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n||data with | |||second data with |\n|}"); add("selser", "Build table with pipe as data [1]", "{| class=\"wikitable\" data-foobar=\"160k0or\"\n!header\n!second header\n|- style=\"color:red;\"\n|data|| style=\"color:red;\" |second data\n|-\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n||data with | |||second data with |\n|}"); -add("selser", "Build table with pipe as data [[4,[[[4],3,2],2,[0,[3],3],0,[0,1,[2]],4,2,0]]]", "{| class=\"wikitable\"\n!s1bdux\n!1d2jp94\n!second header\n|- style=\"color:red;\"\n|\n|-\n| style=\"color:red;\" data-foobar=\"werz9z\" |data with ||| style=\"color:red;\" |1yfsrz1second data with |\n|-\n||data with | |||second data with |\n|}"); +add("selser", "Build table with pipe as data [[4,[[[4],3,2],2,[0,[3],3],0,[0,1,[2]],4,2,0]]]", "{| class=\"wikitable\"\n!s1bdux\n!1d2jp94\n!second header\n|- style=\"color:red;\"\n|\n|-\n| style=\"color:red;\" data-foobar=\"werz9z\" |data with | || style=\"color:red;\" | 1yfsrz1second data with |\n|-\n||data with | |||second data with |\n|}"); +add("selser", "Build table with pipe as data [[2,1]]", "{| class=\"wikitable\"\n!header\n!second header\n|- style=\"color:red;\"\n|data|| style=\"color:red;\" |second data\n|-\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n||data with | |||second data with |\n|}"); add("selser", "Build table with pipe as data [[0,1]]", "{| class=\"wikitable\"\n!header\n!second header\n|- style=\"color:red;\"\n|data|| style=\"color:red;\" |second data\n|-\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n||data with | |||second data with |\n|}"); +add("selser", "Build table with pipe as data [[3,[1,0,3,0,1,0,[3,3,3],3]]]", "{| class=\"wikitable\"\n!header\n!second header\n\n|- data-foobar=\"1eivn9x\"\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n|}"); +add("selser", "Build table with pipe as data [[2,[[0,0,[3]],2,2,0,[3,[2],[2]],4,2,3]]]", "{| class=\"wikitable\"\n!header\n!\n|- style=\"color:red;\"\n|data|| style=\"color:red;\" |second data\n|-\n| style=\"color:red;\" |20jas6data with | || style=\"color:red;\" | 64yvosecond data with |\n|-\n||data with | |||second data with |\n|}"); add("selser", "Build table with pipe as data [[0,[[3,0,4],0,[3,2,4],0,0,3,[3,3,4],0]]]", "{| class=\"wikitable\"\n|gbqns6\n|- style=\"color:red;\"\n|1yui9cn\n|data\n|qqjnv4\n|-\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n|16m5q2m\n|}"); add("selser", "Build table with pipe as data [[2,2]]", "{| class=\"wikitable\"\n!header\n!second header\n|- style=\"color:red;\"\n|data|| style=\"color:red;\" |second data\n|-\n| style=\"color:red;\" |data with | || style=\"color:red;\" | second data with |\n|-\n||data with | |||second data with |\n|}"); +add("selser", "Build table with pipe as data [[3,[3,2,[0,[3],[3]],2,[2,3,1],0,4,0]]]", "{| class=\"wikitable\"\n|- style=\"color:red;\"\n| || style=\"color:red;\" |\n|-\n|1huv435\n| style=\"color:red;\" data-foobar=\"uevssc\" | second data with |\n\n|}"); +add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [[3,[[3,1,[2],0],0]]]", "{|\n! data-foobar=\"qjh2wc\" |bar\n ||hgce9qbaz||quux\n|}"); add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [1]", "{| data-foobar=\"1iuvx2g\"\n!foo||bar\n ||baz||quux\n|}"); add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [[3,2]]", "{|\n!foo||bar\n ||baz||quux\n|}"); add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [[0,1]]", "{|\n!foo||bar\n ||baz||quux\n|}"); @@ -1380,6 +1389,7 @@ add("selser", "Parsoid: Row-syntax table headings followed by comment & table ce add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [2]", "17kr78f\n{|\n!foo||bar\n ||baz||quux\n|}"); add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [[0,2]]", "{|\n!foo||bar\n ||baz||quux\n|}"); add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [[3,1]]", "{|\n!foo||bar\n ||baz||quux\n|}"); +add("selser", "Parsoid: Row-syntax table headings followed by comment & table cells [[2,1]]", "{|\n!foo||bar\n ||baz||quux\n|}"); add("selser", "Table with missing opening tag [[2,[[4,3],3]]]", "\n\n
1pozjc1
"); add("selser", "Table with missing opening tag [[2,[0,3]]]", "\n\n\n
foo
"); add("selser", "Piped link with multiple pipe characters in link text [1]", "[[Main Page||The|Main|Page|]]"); @@ -1777,24 +1787,24 @@ add("selser", "Mixing markup for italics and bold [1]", "'''bold''''''b add("selser", "Mixing markup for italics and bold [2]", "1l5cb3q\n\n'''bold''''''bold''bolditalics'''''"); add("selser", "Mixing markup for italics and bold [[0,0,[4,[4]]]]", "'''bold''''''1c7y5sl''1tr8qis'''''"); add("selser", "Mixing markup for italics and bold [[0,2,1]]", "'es094g''bold''''''bold''bolditalics'''''"); -add("selser", "Illegal character references (T106578) [[[3],0,3,1,0,2,1,4,2,2,4,3,3,0,4,[3],3,0,[3],1]]", ";: �\n;FF: \n: 1ony4eq\n;CR\n: lkzsik\n: 1hd9kma\n: t80d7b\n; Control (low)\n: gcjvm6:  Ÿ\n: 3zv4s3\n;\n;:💩"); -add("selser", "Illegal character references (T106578) [[4,0,0,0,4,0,1,3,0,4,0,0,0,0,0,2,0,3,[4],0]]", ": 9abxrc: �\n; FF\n: rhdk0x\n;CR\n: 1sc3k62: \n; Control (high):  Ÿ\n: t4d2jb\n; Surrogate: ��\n;8f1ytk: 💩"); -add("selser", "Illegal character references (T106578) [[2,2,0,0,0,0,4,1,4,1,3,3,[3],[0,4,0],0,4,1,0,0,1]]", ": xz8gic\n; Null\n: 1ip05mi: �\n; FF: \n: 1tszi1d: \n: 17pbsxa\n;Control (low)\n;:4b92u5Ÿ\n: 109wq3z:��\n; This is an okay astral character: 💩"); +add("selser", "Illegal character references (T106578) [[[3],0,3,1,0,2,1,4,2,2,4,3,3,0,4,[3],3,0,[3],1]]", "; : �\n; FF: \n: 1ony4eq\n; CR\n: lkzsik\n: 1hd9kma\n: t80d7b\n; Control (low)\n: gcjvm6:  Ÿ\n: 3zv4s3\n; \n; :💩"); +add("selser", "Illegal character references (T106578) [[4,0,0,0,4,0,1,3,0,4,0,0,0,0,0,2,0,3,[4],0]]", ": 9abxrc: �\n; FF\n: rhdk0x\n; CR\n: 1sc3k62: \n; Control (high):  Ÿ\n: t4d2jb\n; Surrogate: ��\n; 8f1ytk: 💩"); +add("selser", "Illegal character references (T106578) [[2,2,0,0,0,0,4,1,4,1,3,3,[3],[0,4,0],0,4,1,0,0,1]]", ": xz8gic\n; Null\n: 1ip05mi: �\n; FF: \n: 1tszi1d: \n: 17pbsxa\n; Control (low)\n; :4b92u5Ÿ\n: 109wq3z:��\n; This is an okay astral character: 💩"); add("selser", "Illegal character references (T106578) [2]", "1pzz5ng\n\n; Null: �\n; FF: \n; CR: \n; Control (low): \n; Control (high):  Ÿ\n; Surrogate: ��\n; This is an okay astral character: 💩"); -add("selser", "Illegal character references (T106578) [[[4],0,0,2,3,0,[3],0,0,0,3,2,3,2,0,[2],0,0,0,4]]", ";14gamor: �\n: 1s3kfem\n; FF\n;: \n; Control (low)\n: 1d7dylt\n: xnpfuy:  Ÿ\n;1ho3ewmSurrogate: ��\n; This is an okay astral character\n: t99t45"); +add("selser", "Illegal character references (T106578) [[[4],0,0,2,3,0,[3],0,0,0,3,2,3,2,0,[2],0,0,0,4]]", "; 14gamor: �\n: 1s3kfem\n; FF\n; : \n; Control (low)\n: 1d7dylt\n: xnpfuy:  Ÿ\n; 1ho3ewmSurrogate: ��\n; This is an okay astral character\n: t99t45"); add("selser", "Illegal character references (T106578) [1]", "; Null: �\n; FF: \n; CR: \n; Control (low): \n; Control (high):  Ÿ\n; Surrogate: ��\n; This is an okay astral character: 💩"); -add("selser", "Illegal character references (T106578) [[3,2,0,2,0,4,0,0,0,0,0,0,3,0,4,0,3,0,[2],4]]", ": 1nijh0k: �\n: 1du33yk\n; FF: \n: 1s7r9el\n; CR: \n; Control (low): :  Ÿ\n: b4fxhz\n; Surrogate\n;a9617sThis is an okay astral character\n: 1ri2ysu"); -add("selser", "Illegal character references (T106578) [[0,0,0,2,4,2,1,0,3,0,2,4,[3],0,4,[4],2,4,[2],2]]", "; Null: �\n: 6hfj6v\n; FF\n: i9slal\n: ctf0\n;CR: \n; Control (low)\n: lp8krq: \n: ftnrln\n;:  Ÿ\n: 74e5xk\n;1ego74f\n: sm828x: ��\n: 1tee0ys\n;176owtuThis is an okay astral character\n: mbelro: 💩"); -add("selser", "Illegal character references (T106578) [[[2],0,3,3,0,0,2,1,3,4,0,0,4,2,0,4,0,0,3,2]]", ";wn03ndNull: �: \n: 159zva\n; CR: \n: 1usu01i: \n: 1p8sr11\n: k4om0o:  Ÿ\n: j6cuij: ��\n: 3jj1m2: 💩"); -add("selser", "Illegal character references (T106578) [[[4],1,0,4,1,0,[2],1,4,3,3,0,2,2,0,0,1,4,0,2]]", ";c91986: �\n: sdhxd6: \n;1avi56aCR: \n: 14gfy12\n: 319ezm\n; Control (high)\n: axchx5:  Ÿ\n; Surrogate: ��\n: 156dc2z\n; This is an okay astral character\n: 1l5hrmj: 💩"); -add("selser", "Illegal character references (T106578) [[4,0,0,4,1,0,0,2,0,[2],4,3,0,[0,3,0],3,0,0,0,[4],0]]", ": xlpg99: �\n: 1wwacff: \n; CR\n: 1qhtchf: \n;lxdybfControl (low)\n: 14yfods\n; Control (high): Ÿ\n; Surrogate: ��\n;e41tx7: 💩"); -add("selser", "Illegal character references (T106578) [[1,0,0,[3],0,4,0,0,3,[3],2,0,2,4,0,3,0,2,1,2]]", ";Null: �\n;: \n: 1s86sxw\n; CR: \n;\n: 1l9oavt: \n: 778k4k\n; Control (high)\n: 35lo7h: ��\n: senhqa\n;This is an okay astral character\n: 1u2mi6z: 💩"); -add("selser", "Illegal character references (T106578) [[3,3,4,2,0,3,[3],2,2,0,1,0,0,2,0,0,2,0,1,3]]", ": 1hudr4p\n: spbiwt\n; FF: \n;\n: ci2g0o: \n: 11cbf6v\n; Control (low): \n; Control (high)\n: 18ilm4v:  Ÿ\n; Surrogate\n: 1u0r7vy: ��\n;This is an okay astral character"); -add("selser", "Illegal character references (T106578) [[2,3,0,[3],4,0,[3],0,3,3,0,0,[2],0,0,1,0,4,1,0]]", ": 1z0o38b\n; Null\n;\n: 2qdi5b\n;: : \n;o1ooy4Control (high):  Ÿ\n;Surrogate: ��\n: 1krav05\n;This is an okay astral character: 💩"); -add("selser", "Illegal character references (T106578) [[2,0,0,3,3,0,4,3,2,[2],0,3,[2],[0,2,0],0,1,2,0,[2],0]]", ": 5blrc8\n; Null: �\n: 230ifg\n: 1mumjc1\n;z1bzr0Control (low): \n;m1u6x6Control (high): 11e08na Ÿ\n;Surrogate\n: x9i4bd: ��\n;1kzw03lThis is an okay astral character: 💩"); -add("selser", "Illegal character references (T106578) [[0,4,2,4,0,0,2,2,0,[4],2,0,3,[0,4,0],0,1,0,0,2,2]]", "; Null\n: imnkql\n: 120vfx8\n: m8l04u: \n: 1v6wt8e\n; CR\n: 5etm76: \n;xso31u\n: 1dzblzq: :1turqk0Ÿ\n;Surrogate: ��\n: a1t77b\n; This is an okay astral character\n: 1reix6m: 💩"); -add("selser", "Illegal character references (T106578) [[[2],0,0,0,4,0,1,0,0,1,0,0,[2],4,0,[3],0,0,0,2]]", ";1ypjyujNull: �\n; FF\n: ajh2va\n;CR: \n;Control (low): \n;oiy5jmControl (high)\n: f1dnvq\n;: ��\n; This is an okay astral character\n: iuy797: 💩"); -add("selser", "Illegal character references (T106578) [[1,3,0,1,4,3,2,0,0,[2],0,4,0,1,3,4,1,4,[3],1]]", ";Null\n;FF\n: 1txuuys\n: f07k2q\n; CR: \n;1o4hp5zControl (low): \n: 1h3h8zy\n; Control (high):  Ÿ\n: ck469g:��\n: 9650vr\n;:💩"); +add("selser", "Illegal character references (T106578) [[3,2,0,2,0,4,0,0,0,0,0,0,3,0,4,0,3,0,[2],4]]", ": 1nijh0k: �\n: 1du33yk\n; FF: \n: 1s7r9el\n; CR: \n; Control (low): :  Ÿ\n: b4fxhz\n; Surrogate\n; a9617sThis is an okay astral character\n: 1ri2ysu"); +add("selser", "Illegal character references (T106578) [[0,0,0,2,4,2,1,0,3,0,2,4,[3],0,4,[4],2,4,[2],2]]", "; Null: �\n: 6hfj6v\n; FF\n: i9slal\n: ctf0\n; CR: \n; Control (low)\n: lp8krq: \n: ftnrln\n; :  Ÿ\n: 74e5xk\n; 1ego74f\n: sm828x: ��\n: 1tee0ys\n; 176owtuThis is an okay astral character\n: mbelro: 💩"); +add("selser", "Illegal character references (T106578) [[[2],0,3,3,0,0,2,1,3,4,0,0,4,2,0,4,0,0,3,2]]", "; wn03ndNull: �: \n: 159zva\n; CR: \n: 1usu01i: \n: 1p8sr11\n: k4om0o:  Ÿ\n: j6cuij: ��\n: 3jj1m2: 💩"); +add("selser", "Illegal character references (T106578) [[[4],1,0,4,1,0,[2],1,4,3,3,0,2,2,0,0,1,4,0,2]]", "; c91986: �\n: sdhxd6: \n; 1avi56aCR: \n: 14gfy12\n: 319ezm\n; Control (high)\n: axchx5:  Ÿ\n; Surrogate: ��\n: 156dc2z\n; This is an okay astral character\n: 1l5hrmj: 💩"); +add("selser", "Illegal character references (T106578) [[4,0,0,4,1,0,0,2,0,[2],4,3,0,[0,3,0],3,0,0,0,[4],0]]", ": xlpg99: �\n: 1wwacff: \n; CR\n: 1qhtchf: \n; lxdybfControl (low)\n: 14yfods\n; Control (high): Ÿ\n; Surrogate: ��\n; e41tx7: 💩"); +add("selser", "Illegal character references (T106578) [[1,0,0,[3],0,4,0,0,3,[3],2,0,2,4,0,3,0,2,1,2]]", "; Null: �\n; : \n: 1s86sxw\n; CR: \n; \n: 1l9oavt: \n: 778k4k\n; Control (high)\n: 35lo7h: ��\n: senhqa\n; This is an okay astral character\n: 1u2mi6z: 💩"); +add("selser", "Illegal character references (T106578) [[3,3,4,2,0,3,[3],2,2,0,1,0,0,2,0,0,2,0,1,3]]", ": 1hudr4p\n: spbiwt\n; FF: \n; \n: ci2g0o: \n: 11cbf6v\n; Control (low): \n; Control (high)\n: 18ilm4v:  Ÿ\n; Surrogate\n: 1u0r7vy: ��\n; This is an okay astral character"); +add("selser", "Illegal character references (T106578) [[2,3,0,[3],4,0,[3],0,3,3,0,0,[2],0,0,1,0,4,1,0]]", ": 1z0o38b\n; Null\n; \n: 2qdi5b\n; : : \n; o1ooy4Control (high):  Ÿ\n; Surrogate: ��\n: 1krav05\n; This is an okay astral character: 💩"); +add("selser", "Illegal character references (T106578) [[2,0,0,3,3,0,4,3,2,[2],0,3,[2],[0,2,0],0,1,2,0,[2],0]]", ": 5blrc8\n; Null: �\n: 230ifg\n: 1mumjc1\n; z1bzr0Control (low): \n; m1u6x6Control (high): 11e08na Ÿ\n; Surrogate\n: x9i4bd: ��\n; 1kzw03lThis is an okay astral character: 💩"); +add("selser", "Illegal character references (T106578) [[0,4,2,4,0,0,2,2,0,[4],2,0,3,[0,4,0],0,1,0,0,2,2]]", "; Null\n: imnkql\n: 120vfx8\n: m8l04u: \n: 1v6wt8e\n; CR\n: 5etm76: \n; xso31u\n: 1dzblzq: :1turqk0Ÿ\n; Surrogate: ��\n: a1t77b\n; This is an okay astral character\n: 1reix6m: 💩"); +add("selser", "Illegal character references (T106578) [[[2],0,0,0,4,0,1,0,0,1,0,0,[2],4,0,[3],0,0,0,2]]", "; 1ypjyujNull: �\n; FF\n: ajh2va\n; CR: \n; Control (low): \n; oiy5jmControl (high)\n: f1dnvq\n; : ��\n; This is an okay astral character\n: iuy797: 💩"); +add("selser", "Illegal character references (T106578) [[1,3,0,1,4,3,2,0,0,[2],0,4,0,1,3,4,1,4,[3],1]]", "; Null\n; FF\n: 1txuuys\n: f07k2q\n; CR: \n; 1o4hp5zControl (low): \n: 1h3h8zy\n; Control (high):  Ÿ\n: ck469g:��\n: 9650vr\n; :💩"); add("selser", "Don't fall for the self-closing div [[4]]", "
u0dvch
"); add("selser", "Don't fall for the self-closing div [[3]]", "
"); add("selser", "Don't fall for the self-closing div [2]", "70q99
hello world
"); @@ -1804,6 +1814,8 @@ add("selser", "T153140: Don't break table handling if language converter markup add("selser", "T153140: Don't break table handling if language converter markup is in the cell. [[0,[1,0]]]", "{|\n|- data-foobar=\"f4941y\"\n| -{R|B}-\n|}"); add("selser", "T153140: Don't break table handling if language converter markup is in the cell. [[3,1]]", "{|\n|-\n| -{R|B}-\n|}"); add("selser", "T153140: Don't break table handling if language converter markup is in the cell. [1]", "{| data-foobar=\"1yil0zb\"\n|-\n| -{R|B}-\n|}"); +add("selser", "T153140: Don't break table handling if language converter markup is in the cell. [[0,[[4,[3]],4]]]", "{|\n|-\n|6ff7pa\n| \n|}"); +add("selser", "T153140: Don't break table handling if language converter markup is in the cell. [[2,1]]", "{|\n|-\n| -{R|B}-\n|}"); add("selser", "T153140: Don't break table handling if language converter markup is in the cell. [[4,2]]", "{|\n|-\n| -{R|B}-\n|}"); add("selser", "T153140: Don't break table handling if language converter markup is in the cell. [[0,[1,2]]]", "{|\n|- data-foobar=\"1mgnt53\"\n| -{R|B}-\n|}"); add("selser", "T153140: Don't break table handling if language converter markup is in the cell. [[0,[[0,2],4]]]", "{|\n|-\n|ekvs70\n| -{R|B}-\n|}"); @@ -1950,15 +1962,17 @@ add("selser", "T88318: p-wrapped dash in table. [[3,[1,0,3,4,[2,[2],3,1,3,[0,4]] add("selser", "T88318: p-wrapped dash in table. [[0,[2,3,2,0,1,0]]]", "{|\n!-\n!- \n|-\n|-\n|- \n|- data-foobar=\"xdyvaz\"\n|-\n|
\n-\n|
-\n|}"); add("selser", "T88318: p-wrapped dash in table. [[4,[[2,4,0],4,[0,[3],4,1],3,[0,2,0,[2,2,0],2,[0,3]],0]]]", "{|\n!1egota2\n!-\n!wjv5m9\n!- \n|-\n|\n|162wfcq\n| data-foobar=\"1bj4oky\" |- \n|-\n|ibxbpk\n|-\n|1tcdrkz
vy0sbn\n-\n|1ky2ysb\n|
\n|}"); add("selser", "Testing serialization after deletion of table cells manual", "{|\n!h1 !!h2 !!h3\n|c2|||c3\n|}"); -add("selser", "Testing serialization after deletion of table cells [[0,[[2,4,[3],2,3,2,1],0]]]", "{|\n!bp6f7a\n!h1 \n!1pfb996!!\n!7u9aha\n!1rjjhk6\n|c2|| data-foobar=\"ozcxg4\"|c3\n|}"); +add("selser", "Testing serialization after deletion of table cells [[0,[[2,4,[3],2,3,2,1],0]]]", "{|\n!bp6f7a\n!h1 \n!1pfb996!!\n!7u9aha\n!1rjjhk6\n|c2 || data-foobar=\"ozcxg4\"|c3\n|}"); add("selser", "Testing serialization after deletion of table cells [1]", "{| data-foobar=\"1pbfmqc\"\n!h1 !!h2 !!h3\n| id=\"x\" |c1 {{!}}{{!}}{{!}}c2 |||c3\n|}"); add("selser", "Testing serialization after deletion of table cells [[0,2]]", "{|\n!h1 !!h2 !!h3\n| id=\"x\" |c1 {{!}}{{!}}{{!}}c2 |||c3\n|}"); add("selser", "Testing serialization after deletion of table cells [2]", "1lz8m5h\n{|\n!h1 !!h2 !!h3\n| id=\"x\" |c1 {{!}}{{!}}{{!}}c2 |||c3\n|}"); -add("selser", "Testing serialization after deletion of table cells [[4,[[1,[4],2,4,0,0,1],2]]]", "{|\n! data-foobar=\"1a3kd8x\" |h1!!16ctu4a\n!1sginp4!!h3\n!vriipi\n| id=\"x\" |c1 {{!}}{{!}}{{!}}c2 || data-foobar=\"1idvpjr\"|c3\n|}"); -add("selser", "Testing serialization after deletion of table cells [[0,[[[2],0,0,2,0,1,0],3]]]", "{|\n!yxzrl8h1!!h2!!h3\n!bu6ius\n| id=\"x\" |c1 {{!}}{{!}} data-foobar=\"e7xgo7\"{{!}}c2|||c3\n|}"); -add("selser", "Testing serialization after deletion of table cells [[4,[[1,0,1,0,0,4,4],0]]]", "{|\n! data-foobar=\"1pd0bwt\" |h1!!h2 !! data-foobar=\"1ki24ij\" |h3\n| id=\"x\" |c1 \n|1nk5dsl\n|b1udiz\n|}"); +add("selser", "Testing serialization after deletion of table cells [[4,[[1,[4],2,4,0,0,1],2]]]", "{|\n! data-foobar=\"1a3kd8x\" |h1 !!16ctu4a\n!1sginp4!!h3\n!vriipi\n| id=\"x\" |c1 {{!}}{{!}}{{!}}c2 || data-foobar=\"1idvpjr\"|c3\n|}"); +add("selser", "Testing serialization after deletion of table cells [[0,[[[2],0,0,2,0,1,0],3]]]", "{|\n!yxzrl8h1 !!h2!!h3\n!bu6ius\n| id=\"x\" |c1 {{!}}{{!}} data-foobar=\"e7xgo7\"{{!}}c2|||c3\n|}"); +add("selser", "Testing serialization after deletion of table cells [[2,[[1,0,0,0,1,0,3],0]]]", "{|\n! data-foobar=\"6vrx33\" |h1 !!h2 !!h3\n| id=\"x\" data-foobar=\"2f1vqs\" |c1 {{!}}{{!}}{{!}}c2\n|}"); +add("selser", "Testing serialization after deletion of table cells [[4,[[1,0,1,0,0,4,4],0]]]", "{|\n! data-foobar=\"1pd0bwt\" |h1!!h2 !! data-foobar=\"1ki24ij\" |h3\n| id=\"x\" |c1 \n|1nk5dsl\n|b1udiz\n|}"); add("selser", "Testing serialization after deletion of table cells [[0,[2,4]]]", "{|\n!h1 !!h2 !!h3\n| id=\"x\" |c1 {{!}}{{!}}{{!}}c2 |||c3\n|}"); add("selser", "Testing serialization after deletion of table cells [[0,1]]", "{|\n!h1 !!h2 !!h3\n| id=\"x\" |c1 {{!}}{{!}}{{!}}c2 |||c3\n|}"); +add("selser", "Testing serialization after deletion of table cells [[2,[[4,1,4,2,0,[4],[4]],3]]]", "{|\n!td5l05!! data-foobar=\"1jtzw2c\" |h2\n!3jh5z4\n!athfth\n| id=\"x\" |c1 {{!}}{{!}}{{!}}m73xuk |||7fcrtf\n|}"); add("selser", "Testing serialization after deletion of table cells [[4,2]]", "{|\n!h1 !!h2 !!h3\n| id=\"x\" |c1 {{!}}{{!}}{{!}}c2 |||c3\n|}"); add("selser", "Testing serialization after deletion of table cells [[3,[2,0]]]", "{|\n!h1 !!h2 !!h3\n| id=\"x\" |c1 {{!}}{{!}}{{!}}c2 |||c3\n|}"); add("selser", "Normalizations should be restricted to edited content [2,0,0,2,3]", "1wkaxo3\n\na\n= =\nih04sf\n"); diff --git a/tests/parserTests.txt b/tests/parserTests.txt index b4dd39174..257d9eb88 100644 --- a/tests/parserTests.txt +++ b/tests/parserTests.txt @@ -6776,8 +6776,8 @@ parsoid={ |} !! wikitext/edited {| boo style='border:1px solid black' -| boo style='color:blue' |abc -|boo style='color:blue'|xyz +| boo style='color:blue' | abc +|boo style='color:blue'| xyz |} !! end