Arlolra has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394412 )

Change subject: T180930: Selser shouldn't reuse orig sep for autoinserted ends
......................................................................

T180930: Selser shouldn't reuse orig sep for autoinserted ends

 * This might be more generally applicable than to just tables.

Change-Id: I76418f44bb078c5f70cf2ef6b7982dff58448491
---
M lib/html2wt/DOMHandlers.js
M tests/parserTests-blacklist.js
2 files changed, 16 insertions(+), 31 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/12/394412/1

diff --git a/lib/html2wt/DOMHandlers.js b/lib/html2wt/DOMHandlers.js
index 0720450..c1d626b 100644
--- a/lib/html2wt/DOMHandlers.js
+++ b/lib/html2wt/DOMHandlers.js
@@ -695,7 +695,14 @@
                                        // is never computed and set here.
                                        state.sep.constraints = { a: {}, b: {}, 
min: 1, max: 2 };
                                }
+
+                               if (state.selserMode && dp.autoInsertedEnd) {
+                                       // Set modified flag so that original 
separators aren't
+                                       // reused for the end tag since this is 
new content.
+                                       state.inModifiedContent = true;
+                               }
                                WTSUtils.emitEndTag(dp.endTagSrc || "|}", node, 
state);
+
                                if (indentTable) {
                                        state.singleLineContext.pop();
                                }
diff --git a/tests/parserTests-blacklist.js b/tests/parserTests-blacklist.js
index fda090d..b5d6104 100644
--- a/tests/parserTests-blacklist.js
+++ b/tests/parserTests-blacklist.js
@@ -1645,39 +1645,17 @@
 add("selser", "HTML bullet list, closed tags (T7497) [[4,[2],3,0,0]]", 
"<ul><li>1ll4gfg</li><li>wnpb5dOne</li>\n<li>Two</li>\n</ul>");
 add("selser", "HTML nested ordered list, open tags (T7497) [[2,3,4,[2,1],3]]", 
"<ol><li>1ph637d</li>\n<li>l97dbh</li><li>1lg6gmxTwo:\n<ol 
data-foobar=\"1pegvwc\">\n<li>Sub-one\n<li>Sub-two\n</ol>\n</ol>");
 add("selser", "Fuzz testing: Parser13 [2]", "1s3ei1s\n{| \n| http://a|");
-add("selser", "Fuzz testing: Parser13 [[0,[[1]]]]", "{| \n| 
data-foobar=\"nmk8w6\" http: / a ||}");
-add("selser", "Fuzz testing: Parser13 [1]", "{| data-foobar=\"13wllqe\" \n| 
http://a||}");
-add("selser", "Fuzz testing: Parser13 [[2,2]]", "{|<!--1cxzpcg--> 
\n<!--qebzjb-->| http://a||}");
-add("selser", "Fuzz testing: Parser13 [[4,2]]", 
"{|<!--bch54l--><!--14d1sbn-->\n| http://a||}");
-add("selser", "Fuzz testing: Parser13 [[0,1]]", "{| \n| http://a||}");
-add("selser", "Fuzz testing: Parser13 [[0,2]]", "{| \n<!--l3hcbe-->| 
http://a||}");
-add("selser", "Fuzz testing: Parser13 [[0,[1]]]", "{| \n| http://a||}");
-add("selser", "Fuzz testing: Parser13 [[2,[[1]]]]", "{|<!--13v70zv--> \n| 
data-foobar=\"cmzmng\" http: / a ||}");
-add("selser", "Fuzz testing: Parser13 [[4,[1]]]", "{|<!--mdbo58-->\n| 
http://a||}");
-add("selser", "Fuzz testing: Parser13 [[4,0]]", "{|<!--mfod94-->\n| 
http://a||}");
-add("selser", "Fuzz testing: Parser13 [[2,0]]", "{|<!--upaz27--> \n| 
http://a||}");
+add("selser", "Fuzz testing: Parser13 [1]", "{| data-foobar=\"13wllqe\" \n| 
http://a|\n|}");
+add("selser", "Fuzz testing: Parser13 [[2,2]]", "{|<!--1cxzpcg--> 
\n<!--qebzjb-->| http://a|\n|}");
+add("selser", "Fuzz testing: Parser13 [[4,2]]", 
"{|<!--bch54l--><!--14d1sbn-->\n| http://a|\n|}");
+add("selser", "Fuzz testing: Parser13 [[0,1]]", "{| \n| http://a|\n|}");
+add("selser", "Fuzz testing: Parser13 [[0,2]]", "{| \n<!--l3hcbe-->| 
http://a|\n|}");
+add("selser", "Fuzz testing: Parser13 [[0,[1]]]", "{| \n| http://a|\n|}");
+add("selser", "Fuzz testing: Parser13 [[4,[1]]]", "{|<!--mdbo58-->\n| 
http://a|\n|}");
+add("selser", "Fuzz testing: Parser13 [[4,0]]", "{|<!--mfod94-->\n| 
http://a|\n|}");
+add("selser", "Fuzz testing: Parser13 [[2,0]]", "{|<!--upaz27--> \n| 
http://a|\n|}");
 add("selser", "Fuzz testing: Parser16 [2]", "1jeb7ja\n{|\n!https://||||||");
-add("selser", "Fuzz testing: Parser16 [[0,[[0,2,0,0]]]]", 
"{|\n!https://\n!7nk0ln|||||||}");
-add("selser", "Fuzz testing: Parser16 [[0,[[3,4,0,0]]]]", 
"{|\n!18o2jid|||||}");
-add("selser", "Fuzz testing: Parser16 [[3,2]]", 
"{|<!--9co2pf-->\n!https://|||||||}");
-add("selser", "Fuzz testing: Parser16 [[0,1]]", "{|\n!https://|||||||}");
-add("selser", "Fuzz testing: Parser16 [[3,[2]]]", 
"{|<!--v1br0f-->\n!https://|||||||}");
-add("selser", "Fuzz testing: Parser16 [[0,[[1,1,1,0]]]]", "{|\n! 
data-foobar=\"1ypnx5s\" |https://|| data-foobar=\"lc27jn\" ||| 
data-foobar=\"14qvamm\" ||||}");
-add("selser", "Fuzz testing: Parser16 [1]", "{| 
data-foobar=\"1j1pbvp\"\n!https://|||||||}");
-add("selser", "Fuzz testing: Parser16 [[2,[1]]]", 
"{|<!--1g0ou56-->\n!https://|||||||}");
-add("selser", "Fuzz testing: Parser21 [[2,2]]", 
"{|<!--v1et9x-->\n<!--amz9p1-->! irc://{{ftp://a\"; onmouseover=\"alert('hello 
world');\"\n||}");
-add("selser", "Fuzz testing: Parser21 [1]", "{| data-foobar=\"14162hx\"\n! 
irc://{{ftp://a\"; onmouseover=\"alert('hello world');\"\n||}");
-add("selser", "Fuzz testing: Parser21 [[4,[2]]]", 
"{|<!--14lxyyj--><!--1rwy9y6-->\n! irc://{{ftp://a\"; onmouseover=\"alert('hello 
world');\"\n||}");
-add("selser", "Fuzz testing: Parser21 [[3,[1]]]", "{|\n! irc://{{ftp://a\"; 
onmouseover=\"alert('hello world');\"\n||}");
-add("selser", "Fuzz testing: Parser21 [[0,[[[0,2,0],0,0]]]]", "{|\n! 
dcs53y<nowiki/>irc://{{ftp://a\"; onmouseover=\"alert('hello world');\"\n||}");
-add("selser", "Fuzz testing: Parser21 [[2,[[3,0,0]]]]", 
"{|<!--hudhng-->\n\n||}");
-add("selser", "Fuzz testing: Parser21 [[0,[[[4,[4],0],0,0]]]]", 
"{|\n!3wg2o2[irc://{{ftp://a 686awo]\" onmouseover=\"alert('hello 
world');\"\n||}");
 add("selser", "Fuzz testing: Parser21 [2]", "13y1bui\n{|\n! irc://{{ftp://a\"; 
onmouseover=\"alert('hello world');\"\n|");
-add("selser", "Fuzz testing: Parser21 [[2,[2]]]", 
"{|<!--1zrh54-->\n<!--jjroqc-->! irc://{{ftp://a\"; onmouseover=\"alert('hello 
world');\"\n||}");
-add("selser", "Fuzz testing: Parser21 [[0,[2]]]", "{|\n<!--1jdtwcn-->! 
irc://{{ftp://a\"; onmouseover=\"alert('hello world');\"\n||}");
-add("selser", "Fuzz testing: Parser21 [[0,[[[2,1,2],4,1]]]]", "{|\n!fliidg 
irc://{{ftp://a<nowiki/>mo67tl\" onmouseover=\"alert('hello 
world');\"\n!fllk05\n| data-foobar=\"3u8hle\" ||}");
-add("selser", "Fuzz testing: Parser21 [[3,[[2,0,0]]]]", "{|\n|n9v69n\n! 
irc://{{ftp://a\"; onmouseover=\"alert('hello world');\"\n||}");
-add("selser", "Fuzz testing: Parser21 [[3,1]]", "{|\n! irc://{{ftp://a\"; 
onmouseover=\"alert('hello world');\"\n||}");
 add("selser", "Fuzz testing: Parser22 [[4],0,0]", "nr0us7\n\n{|");
 add("selser", "Fuzz testing: Parser22 [1,2,2]", 
"http://===r:::https://b\n\nfa9uov\n\n1qnwe6o\n{|");
 add("selser", "Fuzz testing: Parser22 [1,3,0]", "http://===r:::https://b\n{|");

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I76418f44bb078c5f70cf2ef6b7982dff58448491
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <[email protected]>

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

Reply via email to