jenkins-bot has submitted this change and it was merged.
Change subject: Several improvements + bug fixes to quote nowiki stripping algo
......................................................................
Several improvements + bug fixes to quote nowiki stripping algo
* This now handles html/extension tags. This is required because quotes
and <ref>..</ref> tags show up on the same line quite commonly.
* The code now only strips one <nowiki/> per line, and specifically the
last <nowiki/> it can strip. In the bargain, several other constraints
in the old algo got relaxed which leads to improvement to <nowiki/>
stripping in tests.
* There are 2 scenarios where non-selser and selser serializer differ:
- Since the nowiki stripping algo only strips a single <nowiki/> per line
(safe but conservative assumption), selser may encounter a single
nowiki on a line and strip it, but non-selser may see 2 or more and
strip one and leave the rest behind.
- Since the stripping is activated only when a nowiki is actually
emitted during escaping, selser may never set this flag and hence
the nowiki stripping algo may not run in selser mode. So, it can
happen that non-selser wts can remove a <nowiki/> from a line
post-edits whereas selser faithfuly preserves an unneeded nowiki.
This shortcoming in selser mode will be addressed in a later patch.
Co-authored by: C. Scott Ananian <[email protected]>
Change-Id: I5e565dec59d4cadca327403f63be84258e88b632
---
M lib/mediawiki.WikitextSerializer.js
M lib/wts.escapeWikitext.js
M tests/parserTests-blacklist.js
M tests/parserTests.txt
4 files changed, 95 insertions(+), 99 deletions(-)
Approvals:
Cscott: Looks good to me, approved
jenkins-bot: Verified
diff --git a/lib/mediawiki.WikitextSerializer.js
b/lib/mediawiki.WikitextSerializer.js
index 56e4584..af62ccb 100644
--- a/lib/mediawiki.WikitextSerializer.js
+++ b/lib/mediawiki.WikitextSerializer.js
@@ -1220,15 +1220,11 @@
return wt.split(/\n|$/).map(function(line) {
// Optimization: We are interested in <nowiki/>s before quote
chars.
// So, skip this if we don't have both.
- if (!(/<nowiki\/>/.test(line) && /'/.test(line))) {
+ if (!(/<nowiki\s*\/>/.test(line) && /'/.test(line))) {
return line;
}
- // * Strip out nowiki-protected strings since we are only
interested in
- // quote sequences that correspond to <i>/<b> tags.
- var simplifiedLine = line.replace(/<nowiki>.*?<\/nowiki>/g, '');
-
- // * Split out all the [[ ]] {{ }} '' ''' '''''
+ // * Split out all the [[ ]] {{ }} '' ''' ''''' <..> </...>
// parens in the regexp mean that the split segments will
// be spliced into the result array as the odd elements.
// * If we match up the tags properly and we see opening
@@ -1239,82 +1235,87 @@
// <i> / <b> / <i><b> tags preceded by a '<nowiki/>, we
// can remove all those nowikis.
// Ex: ''foo'<nowiki/>'' bar '''baz'<nowiki/>'''
- var p =
simplifiedLine.split(/('''''|'''|''|\[\[|\]\]|\{\{|\}\})/);
+ var p =
line.split(/('''''|'''|''|\[\[|\]\]|\{\{|\}\}|<\w+(?:\s+[^>]*?|\s*?)\/?>|<\/\w+\s*>)/);
- // Which of the two scenarios have we encountered?
- // HTML: '<i>foo</i> wt: '<nowiki/>''foo''
- var nowiki_1_seen = false, nowiki_1_failed = false;
- // HTML: <i>foo'</i> wt: ''foo'<nowiki/>''
- var nowiki_2_seen = false, nowiki_2_failed = false;
+ // Which nowiki do we strip out?
+ var nowiki_index = -1;
// Verify that everything else is properly paired up.
- var stack = [];
+ var stack = [], quotesOnStack = 0;
var n = p.length;
+ var nowiki = false, ref = false, tag, selfClose;
for (var j=1; j<n; j+=2) {
- // Don't allow literal html tags in this first pass.
- // We can opt for this later.
- if (/<(?!nowiki)/.test(p[j-1])) { return line; }
-
- if (p[j]===']]') {
- if (stack.pop()!=='[[') { return line; }
- } else if (p[j]==='}}') {
- if (stack.pop()!=='{{') { return line; }
- } else if (p[j][0]==="'" &&
stack[stack.length-1]===p[j]) {
- if (/(^|[^'])'<nowiki\/>/.test(p[j-1])) {
- nowiki_2_seen = true;
- if (/^<nowiki\/>'/.test(p[j-1])) {
- // In this example, we cannot
remove both the <nowiki/>s
- // HTML : <i>'foo'</i>
- // line :
''<nowiki/>'foo'<nowiki/>''
- // pieces: ['',
nowiki/>'foo'<nowiki/>, '']
- nowiki_2_failed = true;
- }
- }
- stack.pop();
- } else {
- if (/(^|[^'])'<nowiki\/>/.test(p[j-1])) {
- nowiki_1_seen = true;
- }
- if (/^<nowiki\/>'/.test(p[j-1])) {
- // In this example, we cannot remove
both the <nowiki/>s
- // HTML : <i>foo</i>'<i>bar</i>
- // line :
''foo''<nowiki/>'<nowiki/>''bar''
- // pieces: ['', foo, '',
<nowiki/>''<nowiki/>, '', bar, '']
- nowiki_1_failed = true;
- }
- stack.push(p[j]);
+ // For HTML tags, pull out just the tag name for
clearer code below.
+ tag = (/^<(\/?\w+)/.exec(p[j]) || '' )[1] || p[j];
+ selfClose = false;
+ if (/\/>$/.test(p[j])) { tag += '/'; selfClose = true; }
+ // Ignore <ref>..</ref> sections
+ if (tag==='ref') { ref = true; continue; }
+ if (ref) {
+ if (tag==='/ref') { ref = false; }
+ continue;
}
- }
- // In this example, we cannot remove both the <nowiki/>s
- // HTML : '<i>foo</i>'
- // line : '<nowiki/>''foo''<nowiki/>'
- // pieces: ['nowiki/>, '', foo, '', <nowiki/>']
- //
- // Similarly with HTML: <i>foo'</i>'
- if (/^<nowiki\/>'/.test(p[n-1])) {
- // SSS FIXME: Later on, we can optimize this further if
this
- // proves to be a big deal.
- //
- // We can remove a subset of nowikis even in this
scenario.
- return line;
+ // Ignore <nowiki>..</nowiki> sections
+ if (tag==='nowiki') { nowiki = true; continue; }
+ if (nowiki) {
+ if (tag==='/nowiki') { nowiki = false; }
+ continue;
+ }
+
+ if (tag===']]') {
+ if (stack.pop()!=='[[') { return line; }
+ } else if (tag==='}}') {
+ if (stack.pop()!=='{{') { return line; }
+ } else if (tag[0]==='/') { // closing html tag
+ // match html/ext tags
+ var opentag = stack.pop();
+ if (tag !== ('/'+opentag)) {
+ return line;
+ }
+ } else if (tag==='nowiki/') {
+ // We only want to process:
+ // - trailing single quotes (bar')
+ // - or single quotes by themselves without a
preceding '' sequence
+ if (/'$/.test(p[j-1]) && !(p[j-1]==="'" &&
/''$/.test(p[j-2])) &&
+ // Consider <b>foo<i>bar'</i>baz</b> or
<b>foo'<i>bar'</i>baz</b>.
+ // The <nowiki/> before the <i> or </i>
cannot be stripped
+ // if the <i> is embedded inside
another quote.
+ (quotesOnStack === 0
+ // The only strippable scenario with a
single quote elt on stack
+ // is: ''bar'<nowiki/>''
+ // -> ["", "''", "bar'", "<nowiki/>",
"", "''"]
+ || (quotesOnStack===1
+ && p[j+1]===""
+ && p[j+2][0]==="'"
+ &&
p[j+2]===stack[stack.length-1])
+ ))
+
+ {
+ nowiki_index = j;
+ }
+ continue;
+ } else if (selfClose) {
+ continue; // skip over self-closing tags
+ } else if (tag[0]==="'" && stack[stack.length-1]===tag)
{
+ stack.pop();
+ quotesOnStack--;
+ } else {
+ stack.push(tag);
+ if (tag[0]==="'") { quotesOnStack++; }
+ }
}
if (stack.length) { return line; }
- // Which nowikis can be remove now?
- if (nowiki_1_seen && !nowiki_1_failed && !nowiki_2_seen) {
- // Only one scenario seen. Safe to strip out all the
<nowiki/>s
- return line.replace(/<nowiki\/>/g, '');
- } else if (!nowiki_1_seen && nowiki_2_seen && !nowiki_2_failed)
{
- // Only one scenario seen. Safe to strip out all the
<nowiki/>s
- return line.replace(/<nowiki\/>/g, '');
- } else {
- // Both scenarios seen. We can only strip out nowikis
in one scenario.
- // For now, we will bail.
+ if (nowiki_index !== -1) {
+ // We can only remove the final trailing nowiki.
//
- // SSS FIXME: With some more smarts, we can pick one of
the two scenarios
- // and selectively remove some nowikis.
+ // HTML : <i>'foo'</i>
+ // line : ''<nowiki/>'foo'<nowiki/>''
+ p[nowiki_index] = '';
+ return p.join('');
+ } else {
return line;
}
}).join("\n");
diff --git a/lib/wts.escapeWikitext.js b/lib/wts.escapeWikitext.js
index 5f7618c..0d1b968 100644
--- a/lib/wts.escapeWikitext.js
+++ b/lib/wts.escapeWikitext.js
@@ -138,6 +138,7 @@
}
if (hasLeadingEscapableQuoteChar(text, opts)) {
+ state.hasQuoteNowikis = true;
out = "<nowiki/>" + (out || text);
}
diff --git a/tests/parserTests-blacklist.js b/tests/parserTests-blacklist.js
index d6d50ca..58d409b 100644
--- a/tests/parserTests-blacklist.js
+++ b/tests/parserTests-blacklist.js
@@ -438,7 +438,7 @@
add("wt2wt", "External links: wiki links within external link (Bug 3695)",
"[http://example.com][[wikilink]]<span> embedded in ext link</span>\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]]<span>.</span>\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''''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", "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|}");
add("wt2wt", "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
+/- ", "{|\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|}");
@@ -1063,7 +1063,7 @@
add("html2wt", "URL-encoding in URL functions (single parameter)",
"/index.php?title=Some_page&=&\n");
add("html2wt", "URL-encoding in URL functions (multiple parameters)",
"/index.php?title=Some_page&q=?&=&\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");
-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'''This year''''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", "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'''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");
add("html2wt", "A table with captions with non-default spaced attributes and a
table row", "{|\n|+ style=\"color: red;\" |caption2\n\n|+ style=\"color: red;\"
| caption3\n\n| foo\n|}\n");
add("html2wt", "Table td-cell syntax variations", "{|\n\n| baz\n\n| foo bar
foo \n| baz\n\n| style=\"color:red;\" | baz\n\n| style='color:red;' \n|
baz\n|}\n");
@@ -1203,7 +1203,7 @@
add("html2wt", "Magic Word: {{SUBJECTPAGENAMEE}}",
"User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason\n");
add("html2wt", "Magic Word: {{NUMBEROFFILES}}", "5\n");
add("html2wt", "Magic Word: {{PAGENAME}}", "Ævar Arnfjörð Bjarmason\n");
-add("html2wt", "Magic Word: {{PAGENAME}} with metacharacters",
"''<nowiki/>'foo & bar = baz'<nowiki/>''\n");
+add("html2wt", "Magic Word: {{PAGENAME}} with metacharacters",
"''<nowiki/>'foo & bar = baz'''\n");
add("html2wt", "Magic Word: {{PAGENAME}} with metacharacters (bug 26781)",
"<nowiki>*RFC 1234 http://example.com/</nowiki>\n");
add("html2wt", "Magic Word: {{PAGENAMEE}}",
"%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason\n");
add("html2wt", "Magic Word: {{PAGENAMEE}} with metacharacters (bug 26781)",
"<nowiki>*RFC_1234_http://example.com/</nowiki>\n");
@@ -1789,10 +1789,7 @@
// Blacklist for selser
add("selser", "Extra newlines followed by heading [1,2,1,3,0,4,0,4,1,3,4]",
"a\n\n40z1qdji2lfskyb9\n\n\n\n=b=\n9h4x5nzjh28rggb9\n\n[[a]]\n\nkup4bo01iztzkt9\n\n\n\nzlbbwe36wkrcnmi\n");
add("selser", "Parsing an URL [[[2]],2,0]",
"[[:fr:🍺|blv27e9oigmpwrk9http://fr.wikipedia.org/wiki/🍺]]\n\n7vcz2sjoo733ow29\n<!--
EasterEgg we love beer, better be able be able to link to it -->");
-add("selser", "Italics and possessives (1) [[2,[[3],0],0]]",
"gf5cs1kl0pki6bt9obtained by ''[[Lunar Prospector|<nowiki/>]]'''s gamma-ray
spectrometer");
add("selser", "Italics and possessives (2) [[2,3,0,0]]",
"0zb8t8umky2pgb9'''''Flaming Pie'''Flaming Pie'''s liner notes");
-add("selser", "Italics and possessives (3) [[0,2,0,[3],4,[4,1],0,0,0]]", "The
first monolingual dictionary written in a Romance language was
86ftvkdoog5vcxr''Sebastián Covarrubias'''
''<nowiki/>''kv0ucinbbogpsyvi''d5zldg7paex6flxr[[Accademia della Crusca]]'',
for Italian, was published. In 1690 in Rotterdam was published, posthumously,
the ''Dictionnaire Universel''.");
-add("selser", "Italics and possessives (3) [[0,0,0,[3],4,[0,1],3,4,3]]", "The
first monolingual dictionary written in a Romance language was ''Sebastián
Covarrubias''' ''<nowiki/>''zlam3qm2v92xd2t9''Vocabolario dell'[[Accademia
della Crusca]]''nz6g2ndeiaw9izfr\n");
add("selser", "Italics and bold: 5-quote opening sequence: (5,6) [[[2]]]",
"''7mymhlqo5nhlg14i'''foo''''''");
add("selser", "Parsoid only: Quote balancing context should be restricted to
td/th cells on the same wikitext line\n(Requires tidy for PHP parser output to
be fixed up) [1]", "{|
data-foobar=\"pl7el6nksli8uxr\"\n!''a!!''b\n|''a||''b\n|}");
add("selser", "Parsoid only: Quote balancing context should be restricted to
td/th cells on the same wikitext line\n(Requires tidy for PHP parser output to
be fixed up) [[4,[[4,0,2,[1],0],4]]]",
"{|<!--44rbogtlx8hncdi-->\n!5oylcgfssnfav2t9!!''b\n!qcinqswgq2r9t3xr\n|''a''||''b<!--b7ncx26rmqiu23xr-->\n|}");
@@ -2050,20 +2047,20 @@
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\n<!-- Unmatching number of opening, closing tags:
-->\nftnac0njf7i1wcdi\n\n''Tom'''s car is bigger than
'''''<nowiki/>'''Susan'''s.\n\nwv6k36cpnikbuik9\n\nvtz1rewhs7i7ldi\n\nPlain
''italic'''s plain");
add("selser", "Unclosed and unmatched quotes
[[1],0,[1],0,[3],0,[2,2],0,4,0,4,2,4,0,3,0,4,0,[[0,[4]],0,3],0,4]", "'''''Bold
italic text '''with bold deactivated''' in between.'''''\n\n'''''Bold italic
text ''with italic deactivated'' in between.'''''\n\ny4h85lgdrtacerk9..spanning
two paragraphs (should not
work).3gnmqbeuuymbo6r'''\n\n3m9bvegcf03sor\n\nskw0gib981xde7b9\n\ndjjwoysazbvgqfr\n\nqcokvvv9z09kke29\n\nvmtyprts14m9rudi\n\n''Tom'''1qr9kmif90ox0f6r'''''<nowiki/>'''Susan'''\n\n5e2ez0in4um78pvi\n");
add("selser", "Unclosed and unmatched quotes
[[[3,0,[3]]],0,[1],0,2,2,3,0,[4],4,[4],0,0,3,0,4,[2,3,3,4,3,0],0,4,2,[0,3,4]]",
"''with bold deactivated'''<nowiki/>'''''\n\n'''''Bold italic text ''with
italic deactivated'' in between.'''''\n\nuimy0isfyrykfbt9\n\n'''Bold
text..\n\nhl888wghmewxw29\n\n4yq4z49x86ywrk9\n\nomsddcwsglihehfr\n\nmumepxtpar0vbo6r\n\nNormal
text.\n\n<!-- Unmatching number of opening, closing tags:
-->dska41gwjbwyu8fr\n\n508yy8ogfxd8ia4i'''This
year''''0o13pli3vxojq0k9s.\n\n12et9k2znm5wb3xr\n\nl97w0g61j6rvbo6r\n\nPlain
iahdy1xbdbjwz5mi");
-add("selser", "Unclosed and unmatched quotes
[4,0,3,0,2,0,0,2,4,0,[4],2,[4],2,4,0,[0,0,2,0,0,0],4,1,0,[0,2,0]]",
"p51yt1t1l2rfi529\n\nrhoigk26dmkg9zfr\n\n'''Bold text..\n\n..spanning two
paragraphs (should not
work).'''\n\n0d622p6w2fenrk9\n\nurr17dfxaytd42t9\n\nt29ejiu69b0jatt9\n\nimupp3pckiq9f6r\n\n92qds57sy49ozuxr\n\nueel0927jmo8yqfr\n\nngdgm7xfofg8pvi\n\n'''This
year''''s election cx7g7aolgz4a38fr''should'' beat '''last
year''''s.\n\n5swpjnt4bod5nrk9\n\n''Tom'''s car is bigger than
'''''<nowiki/>'''Susan'''s.\n\nPlain bktidt0kwhr529''italic'''s plain");
+add("selser", "Unclosed and unmatched quotes
[4,0,3,0,2,0,0,2,4,0,[4],2,[4],2,4,0,[0,0,2,0,0,0],4,1,0,[0,2,0]]",
"p51yt1t1l2rfi529\n\nrhoigk26dmkg9zfr\n\n'''Bold text..\n\n..spanning two
paragraphs (should not
work).'''\n\n0d622p6w2fenrk9\n\nurr17dfxaytd42t9\n\nt29ejiu69b0jatt9\n\nimupp3pckiq9f6r\n\n92qds57sy49ozuxr\n\nueel0927jmo8yqfr\n\nngdgm7xfofg8pvi\n\n'''This
year'<nowiki/>'''s election cx7g7aolgz4a38fr''should'' beat '''last
year''''s.\n\n5swpjnt4bod5nrk9\n\n''Tom'''s car is bigger than
'''''<nowiki/>'''Susan'''s.\n\nPlain bktidt0kwhr529''italic'''s plain");
add("selser", "Unclosed and unmatched quotes
[[1],4,[2],3,3,3,1,2,2,0,2,0,2,3,4,2,[[2],3,3,0,[4],2],0,3,3,[0,4,0]]",
"'''''Bold italic text '''with bold deactivated''' in
between.'''''\n\npvym8fwuqk1hh0k9\n\nqxfz5g7yx7ehr529'''''Bold italic text
''with italic deactivated'' in between.'''''\n\n..spanning two paragraphs
(should not
work).'''<nowiki/>'''\n\nimm43yv5xicw61or\n\nqf82msyi498me7b9\n\n'''Bold tag
left open\n\nh20k7bi0nzdgf1or\n\n''Italic tag left
open\n\n4bg7ac36siztzkt9\n\nNormal
text.\n\nvo6dn3vgrv0a4i\n\newzcuf80f1l6usor\n\n'''tbfhcj88z2w97ldiThis year''''
beat '''m3gmfr9sp4cjif6r'''npe02pgi9a8rrudis.\n\nPlain lg1x7859rhdrt3xrs
plain");
-add("selser", "Unclosed and unmatched quotes
[4,2,2,2,4,4,[0,1],0,1,2,2,0,3,0,0,0,[1,0,1,0,3,3],3,3,4,4]",
"sxp631t0lu4pwrk9\n\nuiov8qw0vsegsyvi\n\ns5pdb3gqeq5pcik9\n\n'''''Bold italic
text ''with italic deactivated'' in
between.'''''\n\n0im0vx321sv2t9\n\nw84opzg7rvpwrk9\n\na10san19w6a8aor\n\n..spanning
two paragraphs (should not work).'''<nowiki/>'''\n\n'''Bold tag left
open'''\n\nzmakc4arcm78pvi\n\nskau1bd5191qncdi\n\n''Italic tag left
open\n\n\n<!-- Unmatching number of opening, closing tags: -->'''This
year'<nowiki/>'''s election ''should'' beat
\n\nfg0el0revo5el8fr\n\n29zcwcjdje0fi529\n");
+add("selser", "Unclosed and unmatched quotes
[4,2,2,2,4,4,[0,1],0,1,2,2,0,3,0,0,0,[1,0,1,0,3,3],3,3,4,4]",
"sxp631t0lu4pwrk9\n\nuiov8qw0vsegsyvi\n\ns5pdb3gqeq5pcik9\n\n'''''Bold italic
text ''with italic deactivated'' in
between.'''''\n\n0im0vx321sv2t9\n\nw84opzg7rvpwrk9\n\na10san19w6a8aor\n\n..spanning
two paragraphs (should not work).'''<nowiki/>'''\n\n'''Bold tag left
open'''\n\nzmakc4arcm78pvi\n\nskau1bd5191qncdi\n\n''Italic tag left
open\n\n\n<!-- Unmatching number of opening, closing tags: -->'''This year''''s
election ''should'' beat \n\nfg0el0revo5el8fr\n\n29zcwcjdje0fi529\n");
add("selser", "Unclosed and unmatched quotes
[[[0,4,[2]]],4,[[3,0,1]],0,3,2,0,0,[[3]],3,3,3,0,0,0,0,3,0,[3,[4],0],0,2]",
"'''''Bold italic text '''frylpuwwxz9kvs4i'''si2oklqrxelmobt9 in
between.'''''\n\n4b0fwpx8i4yousor\n\n'''with italic deactivated'' in
between.'''''\n\n4y74tj37ci7fogvi\n\n..spanning two paragraphs (should not
work).'''\n\n'''<nowiki/>'''\n\nNormal text.\n\n<!-- Unmatching number of
opening, closing tags:
-->\n'''955t9gdexkbdfgvi'''s.\n\n7vsge66w9ew2ke29\n\nPlain ''italic'''s plain");
add("selser", "Unclosed and unmatched quotes
[[[[4],0,0]],0,1,0,2,4,[0,1],0,2,4,4,2,0,0,0,0,[[3],3,0,0,[3],3],0,2,2,3]",
"'''''g25w0ee1muat6gvi'''with bold deactivated''' in between.'''''\n\n'''''Bold
italic text ''with italic deactivated'' in
between.'''''\n\n978osfsmlz9tfbt9\n\n'''Bold
text..\n\n6va1z48gd8wipb9\n\n..spanning two paragraphs (should not
work).'''<nowiki/>'''\n\npap02f80lg8yf1or\n\n'''Bold tag left
open\n\nrc9woq2unjnhfr\n\nvwn5ww762sft7qfr\n\n4tvj8y1sqzg2e29\n\nNormal
text.\n\n<!-- Unmatching number of opening, closing tags:
-->\n'''<nowiki/>'''''should'' beat
'''<nowiki/>'''\n\ngo0uih65ed841jor\n\n''Tom'''s car is bigger than
''Susan'''s.\n\ngxolomlzomtsatt9\n");
-add("selser", "Unclosed and unmatched quotes
[[1],2,3,3,0,0,2,0,[[2]],0,[3],0,3,3,0,0,1,0,[3,0,4],4,3]", "'''''Bold italic
text '''with bold deactivated''' in
between.'''''\n\no48k8kitkr8dunmi\n\n'''Bold
text..\n\njg529j0bl3c2qpvi\n\n..spanning two paragraphs (should not
work).'''\n\n'''86igisuev2sjdcxrBold tag left open'''\n\n\n<!-- Unmatching
number of opening, closing tags: -->'''This year'<nowiki/>'''s election
''should'' beat '''last
year'<nowiki/>'''s.\n\nSusan'''9gtumj4ocnomvx6r\n\nprfakduhs9gousor\n");
-add("selser", "Unclosed and unmatched quotes
[2,0,[1],0,[2],0,[3,0],0,0,2,3,4,[2],2,0,3,[2,3,4,0,[4],0],0,3,3,[3,1,0]]",
"z4argjbmeescq5mi\n\n'''''Bold italic text '''with bold deactivated''' in
between.'''''\n\n'''''Bold italic text ''with italic deactivated'' in
between.'''''\n\n947x1e69qode7b9'''Bold text..\n\n'''\n\n'''Bold tag left
open\n\n3ki8ayg0o64xi529\n\n79eq5ijnx56rbe29\n\ndxlh1ogra88jv2t9Normal
text.\n\nxi7td8h5z9pv6lxr\n\n<!-- Unmatching number of opening, closing tags:
-->23dgn6ecyq281tt9'''This year'<nowiki/>'''39sqeg7p7m0a4i beat
'''oiu6lbk4gnrn3ik9'''s.\n\n''italic'''s plain");
+add("selser", "Unclosed and unmatched quotes
[[1],2,3,3,0,0,2,0,[[2]],0,[3],0,3,3,0,0,1,0,[3,0,4],4,3]", "'''''Bold italic
text '''with bold deactivated''' in
between.'''''\n\no48k8kitkr8dunmi\n\n'''Bold
text..\n\njg529j0bl3c2qpvi\n\n..spanning two paragraphs (should not
work).'''\n\n'''86igisuev2sjdcxrBold tag left open'''\n\n\n<!-- Unmatching
number of opening, closing tags: -->'''This year'<nowiki/>'''s election
''should'' beat '''last
year''''s.\n\nSusan'''9gtumj4ocnomvx6r\n\nprfakduhs9gousor\n");
+add("selser", "Unclosed and unmatched quotes
[2,0,[1],0,[2],0,[3,0],0,0,2,3,4,[2],2,0,3,[2,3,4,0,[4],0],0,3,3,[3,1,0]]",
"z4argjbmeescq5mi\n\n'''''Bold italic text '''with bold deactivated''' in
between.'''''\n\n'''''Bold italic text ''with italic deactivated'' in
between.'''''\n\n947x1e69qode7b9'''Bold text..\n\n'''\n\n'''Bold tag left
open\n\n3ki8ayg0o64xi529\n\n79eq5ijnx56rbe29\n\ndxlh1ogra88jv2t9Normal
text.\n\nxi7td8h5z9pv6lxr\n\n<!-- Unmatching number of opening, closing tags:
-->23dgn6ecyq281tt9'''This year''''39sqeg7p7m0a4i beat
'''oiu6lbk4gnrn3ik9'''s.\n\n''italic'''s plain");
add("selser", "Unclosed and unmatched quotes
[[2],0,4,3,[2],3,3,4,[[2]],0,0,2,3,4,0,0,4,2,[[3,[4]],2,0],3,2]",
"4yw4wxjunjtw3ik9'''''Bold italic text '''with bold deactivated''' in
between.'''''\n\nis7cyalf54su4n29\n\nmpbxmb8jpqlg14i'''Bold
text..'''\n\nalbr13x2jt273nmi\n\n'''6g5d8o738wave7b9Bold tag left
open'''\n\n''Italic tag left open\n\nteulxe8k1ma0dx6r\n\nxou6as0vzir7ldi\n<!--
Unmatching number of opening, closing tags:
-->\nujbw98y12pxecdi\n\nis2fqvz346byy14i\n\n'''''kzqmouenkvz8semi'''''9tj86gikh3j1c3di'''Susan'''s.\n\ni4wvgq117adobt9\n\nPlain
''italic'''s plain");
add("selser", "Unclosed and unmatched quotes
[[[0,4,[4]]],4,[[[3],0,0]],3,4,2,[0,3],0,2,4,1,3,0,3,0,2,[3,2,[4],0,2,0],0,3,0,2]",
"'''''Bold italic text
'''75o98j53ggyqr529'''dy2un1421co0qkt9'''''\n\nambk3df76pfrbe29\n\n'''''<nowiki/>''with
italic deactivated'' in
between.'''''\n\nmlan2o9gwrx2bj4i\n\n5ad1bsnc7xrvbo6r\n\n..spanning two
paragraphs (should not work).\n\n7rqyhyinmtqvkj4i\n\n'''Bold tag left
open\n\n6e1728i1rre019k9\n\n''Italic tag left open''\n\nNormal text.\n\n<!--
Unmatching number of opening, closing tags:
-->yrma779mh822csor\n\nzowg8vddfmxcg14is election ''bpl4hu1cvunmi'' beat
mqxj0davy046xbt9'''last year''''s.\n\nsrp1nabhht7ta9k9\n\nPlain ''italic'''s
plain");
add("selser", "Unclosed and unmatched quotes
[[[1,0,1]],3,[4],2,2,0,0,2,0,0,3,2,0,2,0,0,[[2],0,[3],3,0,4],0,[1,0,0],0,4]",
"'''''Bold italic text '''with bold deactivated''' in
between.'''''\n\n44b370raypmk7qfr\n\ni211swg0nbpam7vi\n\nvavmabtdw75jyvi\n\n'''Bold
text..\n\n..spanning two paragraphs (should not
work).'''\n\n4p1evrnwbqd26gvi\n\n'''Bold tag left
open\n\newqyg6brwjmrt3xr\n\nNormal text.\n\nah55m0efoatnjyvi\n\n<!-- Unmatching
number of opening, closing tags: -->\n'''o7plzsqaknmte29This year'<nowiki/>'''s
election ''<nowiki/>'''''last year'<nowiki/>'''2yo5fdbdlipy14i\n\n''Tom'''s car
is bigger than '''''<nowiki/>'''Susan'''s.\n\nllfjggl4suhgds4i\n");
add("selser", "Unclosed and unmatched quotes
[[3],0,[1],0,3,2,1,4,4,4,4,3,[2],0,0,0,3,0,3,2,[4,3,3]]", "\n\n'''''Bold italic
text ''with italic deactivated'' in
between.'''''\n\nx1xcylcyh7gphkt9\n\n..spanning two paragraphs (should not
work).'''\n\nnf1j27vv64unmi\n\n8gq7zshkmb49529\n\nequpikb2dtj1nhfr\n\n9qkbw2p05e6a8aor\n\nxmkojfga7ja1c3diNormal
text.\n\n<!-- Unmatching number of opening, closing tags:
-->\nrmvdbh91k72xzuxr\n\n2mzfijueenq4zpvi");
add("selser", "Unclosed and unmatched quotes
[3,0,[2],0,[[2]],3,[3,0],0,4,4,0,0,3,2,0,3,[[4],2,4,0,3,0],2,3,3,[3,3,0]]",
"\nt6n1bkvx9wq7u8fr'''''Bold italic text ''with italic deactivated'' in
between.'''''\n\n'''mdiwcalkyki6bt9Bold
text..'''\n\n'''<nowiki/>'''\n\n1il337h4ozu84cxr\n\nowkwkmpgu45z5mi\n\n''Italic
tag left open\n\n0jlauri2d7gjsjor\n\n<!-- Unmatching number of opening, closing
tags: -->'''xapa2a5a6cdw8kt9'''lc002uv6d1dzpvis election fik23fdz9d89qkt9 beat
s.\n\n8ykwjs7kuwg0hpvi\n\ns plain");
-add("selser", "Unclosed and unmatched quotes
[2,4,3,0,2,0,1,0,[3],0,[2],0,2,0,0,2,[2,2,4,0,1,0],2,4,3,4]",
"re6gnnkhd1tnjyvi\n\n'''''Bold italic text '''with bold deactivated''' in
between.'''''\n\nbdwnekfnkxei2j4i\n\nva244jbhttpdgqfr\n\n'''Bold
text..\n\n..spanning two paragraphs (should not
work).'''\n\nlrd6syi4ygugzaor''Italic tag left
open\n\nknfaulivfgca0pb9\n\nNormal text.\n\n<!-- Unmatching number of opening,
closing tags: -->h8w8s0eci66tuik9\n\nu9daa8hfmgm5z5mi'''This
year''''s4k3bfthkfq1tt9s election am5ar352e2ltbj4i beat '''last
year''''s.\n\nrgsn8f7qx23p7gb9\n\nlhg77py8ot21emi\n\n7h6jcsa4wmzsq0k9\n");
-add("selser", "Unclosed and unmatched quotes
[[1],2,4,0,[4],0,[4,0],0,[[2]],3,2,0,2,0,0,2,[0,2,2,0,1,0],0,1,0,2]",
"'''''Bold italic text '''with bold deactivated''' in
between.'''''\n\n91y6zy5s4079zfr\n\nmkyoq2vkvt0jatt9\n\n8yeajt4jwaru23xr\n\nn2z6ghxy6lp7gb9'''<nowiki/>'''\n\n'''9c8lhwf3v6zgp66rBold
tag left open'''\n\nootbfqoaxawi2j4i\n\n''Italic tag left
open\n\nvv89fig83pst6gvi\n\nNormal text.\n\n<!-- Unmatching number of opening,
closing tags: -->73vckpnoy6s3v7vi\n\n'''This year''''eedgwt17jt9be29s election
gqta5jrflissjor''should'' beat '''last year''''s.\n\n''Tom'''s car is bigger
than '''''<nowiki/>'''Susan'''s.\n\nz1mgwtgr2xjhh0k9\n\nPlain ''italic'''s
plain");
+add("selser", "Unclosed and unmatched quotes
[2,4,3,0,2,0,1,0,[3],0,[2],0,2,0,0,2,[2,2,4,0,1,0],2,4,3,4]",
"re6gnnkhd1tnjyvi\n\n'''''Bold italic text '''with bold deactivated''' in
between.'''''\n\nbdwnekfnkxei2j4i\n\nva244jbhttpdgqfr\n\n'''Bold
text..\n\n..spanning two paragraphs (should not
work).'''\n\nlrd6syi4ygugzaor''Italic tag left
open\n\nknfaulivfgca0pb9\n\nNormal text.\n\n<!-- Unmatching number of opening,
closing tags: -->h8w8s0eci66tuik9\n\nu9daa8hfmgm5z5mi'''This
year'<nowiki/>'''s4k3bfthkfq1tt9s election am5ar352e2ltbj4i beat '''last
year''''s.\n\nrgsn8f7qx23p7gb9\n\nlhg77py8ot21emi\n\n7h6jcsa4wmzsq0k9\n");
+add("selser", "Unclosed and unmatched quotes
[[1],2,4,0,[4],0,[4,0],0,[[2]],3,2,0,2,0,0,2,[0,2,2,0,1,0],0,1,0,2]",
"'''''Bold italic text '''with bold deactivated''' in
between.'''''\n\n91y6zy5s4079zfr\n\nmkyoq2vkvt0jatt9\n\n8yeajt4jwaru23xr\n\nn2z6ghxy6lp7gb9'''<nowiki/>'''\n\n'''9c8lhwf3v6zgp66rBold
tag left open'''\n\nootbfqoaxawi2j4i\n\n''Italic tag left
open\n\nvv89fig83pst6gvi\n\nNormal text.\n\n<!-- Unmatching number of opening,
closing tags: -->73vckpnoy6s3v7vi\n\n'''This year'<nowiki/>'''eedgwt17jt9be29s
election gqta5jrflissjor''should'' beat '''last year''''s.\n\n''Tom'''s car is
bigger than '''''<nowiki/>'''Susan'''s.\n\nz1mgwtgr2xjhh0k9\n\nPlain
''italic'''s plain");
add("selser", "A table with captions with non-default spaced attributes and a
table row [[2,0,2,3,3,3]]", "{|<!--69d5z7pa8iio1or-->\n|+style=\"color:
red;\"|caption2<!--1r97810ys18j8aor-->\n|}");
add("selser", "A table with captions with non-default spaced attributes and a
table row [2]", "ogl2d411a038r529\n{|\n|+style=\"color: red;\"|caption2\n|+
style=\"color: red;\"| caption3\n|-\n| foo\n|}");
add("selser", "A table with captions with non-default spaced attributes and a
table row [[4,[3],2,0,3,[[3,4],4]]]", "{|<!--glpyv8ws43elv7vi-->\n|+
style=\"color: red;\" |<!--977mpdg7bdg6i529-->\n|+ style=\"color: red;\"|
caption3\n|-\n|vnlowwkt14hadcxr<!--tw8w8jwmz4p1fw29-->\n|}");
@@ -2568,7 +2565,6 @@
add("selser", "Mixing markup for italics and bold [2]",
"sype68ertrsbgldi\n\n'''bold''''''bold''bolditalics'''''");
add("selser", "Mixing markup for italics and bold [[0,0,[4,[4]]]]",
"'<nowiki/>''bold''''''ofte4w4zkeh77gb9''xbrpnwqlrllerk9'''''");
add("selser", "Mixing markup for italics and bold [[0,2,1]]",
"'7hmry58pm8to6r''bold''''''bold''bolditalics'''''");
-add("selser", "Mixing markup for italics and bold [[0,0,4]]",
"'<nowiki/>''bold'''vs6oe9iomie8kt9");
add("selser", "Section extraction, <pre> around bogus header (bug 10309)
[[2],2,[3],3,0,0,2]", "==0mqyujy54j1qbyb9 Section One
==\nyzn329uexnp3z0k9\n<pre></pre>\n\n== Section Two
==\nppzttjn4r8gp66r\n\nstuff");
add("selser", "Handling of 
 in URLs [[[2]]]", "*a1yhylbtfjgrdx6r\n*
irc://
a");
add("selser", "Handling of 
 in URLs [[[[2]]]]", "** 0r68g30euvbfn7b9\n*
irc://
a");
@@ -2788,15 +2784,7 @@
add("selser", "Headings: 4a'. No escaping needed (Parsoid bug T84903) [1]", "=
''=''foo= =");
add("selser", "Headings: 5. Empty headings [[2],3,2,0,4,4,0,2,1,3,0]",
"=hnjo2713bjvjwcdi<nowiki/>=\nx2d05yq3dapaxlxr\n==<nowiki/>==\n\nkaovt9si227ta9k9\n\nb2688fvzpaocrf6r\n====<nowiki/>====\nljshl952j0emte29\n\n=====<nowiki/>=====\n\n======<nowiki/>======");
add("selser", "Headings: 6a. Heading chars in SOL context (with trailing
spaces) [4,0,1,0,4,4,[2],3]", "o4fu7yz6zedvlsor\n\n<nowiki>=a=</nowiki>
\n\nfzi337zwgfmbzkt9\n\nrziif3qr3rspp66r\n\nzm9kz709iqpsnhfr<nowiki>=a=</nowiki>
\t");
-add("selser", "1a. Quotes inside <b> and <i>
[[[0,2,0],3,0,0,2,0,1,2,0,[4,2,2],0,1,3,0,2,[4,4,[2,0],0],3,[3],0,0,1,3,2,4,0,[2,0],1,0,3,4,2,0,3,0,0,0,0,2,0,0,0,2,4,0,0,4]]",
"''<nowiki/>bt5073jrxz2gldi'foo'<nowiki/><nowiki>''foo''</nowiki>''\n6563iftvc71wz5mi''<nowiki>'''foo'''</nowiki>''\n''foo''yv6gd1r11qbyb9<nowiki/>'s\n'''ge4wqkqzeoqg2e29ycci4uro5wx6flxr'foo'onh4xihxdek4kj4i<nowiki/>'''\n'''<nowiki>''foo''</nowiki><nowiki>'''foo'''</nowiki>'''f1gwwblkysii19k9\n'''em5maqbfah71ra4izwselowkgxu07ldi''fmyr1ptercf2yb9bar'<nowiki/>''baz'''<nowiki/>'s\n'''foo''s1x6z3q0pwfgk3xr''foo''eo98hc80ue7mn29'\n''luf993p203a6ecdifoo'<nowiki/>''<nowiki/>'\n'9ixyk03e6k73nmib3uz6pdpbziod2t9<nowiki/>'\n'\n'''foo'''<nowiki/>'\n'n8h003eevc1pp66r<nowiki/>'''foo'''<nowiki/>'\nqzypu69mxf450zfr''fools'<span>
errand</span>''f9fa9v2yqf7s0pb9''<span>fool</span>'s
errand''\na|!*#-:;+-~[]{}b'eeuga531ydivbo6r\n");
-add("selser", "1a. Quotes inside <b> and <i>
[[[3,3,0],4,[1],4,3,0,2,1,3,4,0,3,0,0,0,[3,0,[0,4],4],0,[4],0,0,1,3,2,0,0,2,0,3,0,2,0,2,3,0,0,0,4,1,0,0,4,[2,4],0,[[3],2],2,[3]]]",
"''<nowiki/>''a2aq0z7cuxjvpldi''<nowiki>''foo''</nowiki>''9piehljxoluwhfr\ne6q2xxx0b6l59udi''foo''<nowiki/>q6w1s6us1iuul3di\n\n'''<nowiki>'''foo'''</nowiki>'''\n'''<nowiki/>''bar'ybu5hd1znsqyqfr''cuvzlap9b55vzpvi'''\n'''hut6xkk4oo3cjtt9'''<nowiki/>'s\n'''foo''nm4nb2g9j0olmcxr''foo''<nowiki/>'\npy6mqjhk5w1urf6r''foo'''0qji1uolvfpf1or''foo''hf3w84agckiq9f6r'\n'\n'''foo'''<nowiki/>mp0af8wt5qj8aor<nowiki/>'''foo'''<nowiki/>tpntrj9x2py3z0k9''se24b272ye9x80k9fools'uqazz0dff88e61or''\n''<span></span>km43kpexldte29's
errand''848od9gkimcgnwmi\na|!*#-:;+-~[]{}b'''''");
-add("selser", "1a. Quotes inside <b> and <i>
[[0,3,[4],0,[[2]],0,2,0,0,0,0,[3],2,[[3]],3,[0,0,[0,4],4],0,0,0,0,[4],3,0,4,2,2,0,0,4,1,1,3,[4],0,2,3,0,0,2,4,0,0,4,[0,4],0,0]]",
"''<nowiki/>'foo'<nowiki/>tsfw9cjtqui35wmi''\n''<nowiki>182inw1tk68byb9'''foo'''</nowiki>''\nc6mfyxdscoqd7vi''foo''<nowiki/>'s\n'''<nowiki/>'foo'<nowiki/>'''\n'''<nowiki/>'''sdd2o1secj714i\n'''<nowiki></nowiki>foo'''bar'c89au4pzo2w6d2t9''oogv339xjzg58kt9'''\n'''foo'''<nowiki/>'s\n'''enb3w64fv0vhd7vifoo''bs9005206ublnmi2blx53k6prv0a4i'\nalbr0hm9jx94fgvi''foo'<nowiki/>''<nowiki/>'\n'4sawaxuizyfrbe29''foo''<nowiki/>'''lqvzfaqu8nkx1or'''\nfg466f0xspehr529'''foo''''\n'gyhbn34qosp833di'''foo'''it67fnw01vzk6gvi'\n''fools'<span>
errand</span>''yzxdhphhxj6skyb9''<span>fool</span>7ct783zzivayk3xr''\na|!*#-:;+-~[]{}b'''x''");
-add("selser", "1a. Quotes inside <b> and <i>
[[[3,0,2],3,1,2,4,0,0,0,0,[4,0,2],0,1,0,[3],0,4,3,4,0,0,0,3,[3],0,4,2,3,3,3,0,0,0,0,2,0,1,0,2,1,3,4,2,2,[[3],0],0,0]]",
"''<nowiki/>'foo'hb272u479lwstt9<nowiki/><nowiki>''foo''</nowiki>''aoyeu230t9gdgqfr\n04ca25pavp25ipb9\n''foo''<nowiki/>'s\n'''wbf8tial32n5qaor'foo'mbpoyazybz5v1jor<nowiki/>'''\n'''<nowiki>''foo''</nowiki>'''\n'''<nowiki/>'''\n83hj9lpj8e2hjjorsknq5qdggncow29<nowiki/>'s\n'''foo''<nowiki/>ej5yiwkc78og8pvijmi4ecydnbi6bt9''foo'<nowiki/>foo''<nowiki/>'\n''''foo'''ejy8l4b1rftj4i\n'''foo'''<nowiki/>'\n'8l75n41g0lmu0udi<nowiki/>'''foo'''9611xbmxjkbj4it4tcd2aoqv706bt9''fools'<span>
errand</span>''vx2a5pbwqkaqncdi\n''<span></span>'s
errand''\na|!*#-:;+-~[]{}b'''x''");
-add("selser", "1a. Quotes inside <b> and <i>
[[[1,0,3],4,1,3,[2],2,0,3,2,[4,2,3],0,0,4,[4],0,1,0,[4],0,2,2,4,0,1,2,[0,2],3,4,4,3,4,0,1,0,3,3,3,0,0,0,2,2,3,0,0,4]]",
"''<nowiki/>'foo'''pge1hykjt703haor''<nowiki>''foo''</nowiki>w08bna5xdaacq5mi<nowiki>'''foo'''</nowiki>''aesijxhqdnjc3di\n''foo''cannellrzp6kzkt9's\n'''thlhwyja3c6av2t92oxo48has9jjdcxr'foo''''\n'''<nowiki>''foo''</nowiki>'''g9rxbqb1zxrjxlxr'''sw6univttbo3whfr'''\n'''foo'<nowiki/>''bar'<nowiki/>''baz'''\n'''jlixmcok0ylul3di'''<nowiki/>wezi27zx8grb2o6r's\n'pcje9sp2y329ms4i''foo''pkc0t9plxu0x80k9''foo''<nowiki/>ob8egxhxmcissjor'\n''foo'g5n0qfch7kmg3nmi<nowiki/>''awgz6l4ct17i7ldirzm72kojkpy3z0k9yh28rbjxse0fi529'\n''''foo'''\n<nowiki/>'''foo'''<nowiki/>i5vhkstze1rwwmi'\n0xu46kjjk7m5z5mi''fools'<span>
errand</span><span>fool</span>'s
errand''\na|!*#-:;+-~[]{}b'cigpkk65q8woecdi\n");
-add("selser", "1b. Quotes inside <b> and <i> with other chars
[[0,0,4,[3],0,0,2,[4],4,[2],0,4,0,0,3,[3]]]",
"'''a''3gci9ha4rdzbmx6r''''\n''a'''vycpv8lhr70q9f6r foo
''bf7gvd6gcq1cq5mi''o4n15sbzbqhbyb9''0ji5zak6bb9vbo6ra'<nowiki/>'' foo
j20txbzjjzynl8fr\n[[foo]]''<nowiki/>''");
-add("selser", "1b. Quotes inside <b> and <i> with other chars
[[0,4,0,2,0,0,0,[[3]],0,1,3,0,2,0,0,2]]", "'302aki5f2py3z0k9 foo
88n32t7sunbtke29''[[bar]]''\n''a''' foo
''[[bar|<nowiki/>]]''\n''a'<nowiki/>'''''{{echo|[[bar]]}}'''2ol0arblnrazto6r\n[[foo]]
x'ysrsrn15d6v6xbt9''[[bar]]''");
-add("selser", "1b. Quotes inside <b> and <i> with other chars
[[0,4,0,[2],0,2,2,0,3,[4],3,0,0,2,0,4]]", "'w4asul8qimxtj4i foo
''1f6sa9cy04dbzkt9[[bar]]''\neo263uzvkpj5rk9''a'''kwinsz17mqz7iudi foo
''[[bar]]2tre7w1gw240lik9'''''{{echo|[[bar]]}}'''\nhmsrjaduegj02j4i[[foo]]
x'oesi483rxp3nmi\n");
-add("selser", "1b. Quotes inside <b> and <i> with other chars
[[2,1,4,[[4]],0,2,2,[3],0,1,4,4,0,3,3,3]]",
"cscet463fsrcz0k9'''a''s7qwoec5e2joflxr''[[bar|59kawpkk6t5ljtt9]]''\not5tp8zlp0ou5wmi''a'''2go8ao5bpx1j1yvi
foo ''<nowiki/>''\n''a'''sk4p6kv0tshy3nmi5c63curk1chm2t9\n");
+add("selser", "1a. Quotes inside <b> and <i>
[[0,0,[[2]],0,[3],4,0,2,0,1,0,[[3]],3,[[3]],2,4,0,0,0,0,0,0,[3],0,3,2,1,4,[4],0,4,1,0,2,2,0,[3],3,4,[2,0],0,2,0,1,4,3,3,0,4]]",
"''<nowiki/>'foo'''\n''<nowiki>1e9muev8ss5g66r''foo''</nowiki>''\n''<nowiki/>''4d5ycsl2y8kw3ik9''foo''aupv0np9y23dte29<nowiki/>'s\n'''<nowiki/>'foo''''\n'''<nowiki></nowiki><nowiki></nowiki>'''7v99l2g58uf8ncdi\nt25xhsjezsxuhaor\n'''foo'''<nowiki/>'s\n'''foo''\n''<nowiki/>''<nowiki/>4jfax21zqk273nmi''foo'''<nowiki/>4cjse042djk8olxr''uuxn7j5hunlsdcxr''<nowiki/>gxsdwksxmc5zh0k9'''foo'''\nebmq8hwo94yousor'''foo'''8vbmckzt1zg58kt9<nowiki/>'\n''''<nowiki/>'''uvlpop77khtihpvi''8bzt3z0trdwh4cxrfools'<span>
errand</span>''\n4ni438wzhzsvpldi''<span>fool</span>'s
errand''\n'<nowiki/>457s295v8krtqpvi\na|!*#-:;+-~[]{}b'itx2quuq6dqb0529\n");
add("selser", "HTML tag with broken attribute value quoting [1]", "<span
title=\"Hello world>Foo</span>");
add("selser", "HTML tag with broken attribute value quoting [2]",
"zlkpme7jgj76tj4i\n\n<span title=\"Hello world>Foo</span>");
add("selser", "HTML tag with broken attribute value quoting [[2]]",
"19ydfukj49zoajor<span title=\"Hello world>Foo</span>");
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index f7dc0a9..6b999ec 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -706,7 +706,7 @@
!! test
Italics and bold: 4-quote opening sequence: (4,4) w/ nowiki
!! wikitext
-'<nowiki/>'''foo'<nowiki/>'''
+'<nowiki/>'''foo''''
!! html
<p>'<b>foo'</b>
</p>
@@ -20968,24 +20968,25 @@
!! options
parsoid=html2wt,wt2wt
!! wikitext
-''<nowiki/>'foo'<nowiki/>''
+''<nowiki/>'foo'''
''<nowiki>''foo''</nowiki>''
''<nowiki>'''foo'''</nowiki>''
''foo''<nowiki/>'s
-'''<nowiki/>'foo'<nowiki/>'''
+'''<nowiki/>'foo''''
'''<nowiki>''foo''</nowiki>'''
'''<nowiki>'''foo'''</nowiki>'''
'''foo'<nowiki/>''bar'<nowiki/>''baz'''
'''foo'''<nowiki/>'s
'''foo''
''foo''<nowiki/>'
-''foo'<nowiki/>''<nowiki/>'
-'<nowiki/>''foo''<nowiki/>'
+''foo'''<nowiki/>'
+'''foo''<nowiki/>'
''''foo'''
'''foo'''<nowiki/>'
-'<nowiki/>'''foo'''<nowiki/>'
+''''foo'''<nowiki/>'
''fools'<span> errand</span>''
''<span>fool</span>'s errand''
+'<nowiki/>''foo'' bar '''baz''
a|!*#-:;+-~[]{}b'''x''
!! html/*
<p><i>'foo'</i>
@@ -21006,12 +21007,13 @@
'<b>foo</b>'
<i>fools'<span> errand</span></i>
<i><span>fool</span>'s errand</i>
+'<i>foo</i> bar '<i>baz</i>
a|!*#-:;+-~[]{}b'<i>x</i>
</p>
!! end
!! test
-1b. Quotes inside <b> and <i> with other chars
+1b. Quotes inside <b> and <i> with other tags on same line
!! options
parsoid=html2wt,wt2wt
!! wikitext
@@ -21019,11 +21021,15 @@
''a''' foo ''[[bar]]''
''a''' foo '''{{echo|[[bar]]}}'''
[[foo]] x'''[[bar]]''
+'''foo'' <ref>test</ref>
+'''foo'' <div title="name">test</div>
!! html
'<i>a</i> foo <i><a rel="mw:WikiLink" href="Bar" title="Bar">bar</a></i>
<i>a'</i> foo <i><a rel="mw:WikiLink" href="Bar" title="Bar">bar</a></i>
<i>a'</i> foo <b><a rel="mw:WikiLink" href="Bar" title="Bar"
typeof="mw:Transclusion"
data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[[bar]]"}},"i":0}}]}'>bar</a></b>
<a rel="mw:WikiLink" href="Foo" title="Foo">foo</a> x'<i><a href="Bar"
rel="mw:WikiLink" title="Bar">bar</a></i>
+'<i>foo</i> <span class="reference" id="cite_ref-1-0" rel="dc:references"
typeof="mw:Extension/ref"
data-mw='{"name":"ref","body":{"html":"test"},"attrs":{}}'><a
href="#cite_note-1">[1]</a></span>
+'<i>foo</i> <div title="name">test</div>
!! end
!! test
--
To view, visit https://gerrit.wikimedia.org/r/181177
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5e565dec59d4cadca327403f63be84258e88b632
Gerrit-PatchSet: 12
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[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