jenkins-bot has submitted this change and it was merged. Change subject: Sync up with Parsoid parserTests. ......................................................................
Sync up with Parsoid parserTests. This now aligns with Parsoid commit 3d6d0723f93e2a838df717b5036e5cd6b0345eca Change-Id: Iadc98cc4cc33c7725e5fbf4a16df7e1a898aee80 --- M tests/parser/parserTests.txt 1 file changed, 206 insertions(+), 4 deletions(-) Approvals: Subramanya Sastry: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index e21ee3d..3266b16 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -17035,6 +17035,29 @@ b</p> !! end +#### --------------- Behavior Switches -------------------- +!! test +1. Valid behavior switches should be escaped +!! options +parsoid=html2wt +!! input +<nowiki>__TOC__</nowiki> +!! result +__TOC__ +!! end + +!! test +2. Invalid behavior switches should not be escaped +!! options +parsoid=html2wt +!! input +__TOO__ +__|__ +!! result +__TOO__ +__|__ +!! end + #### --------------- HTML tags --------------- #### 1. a tags #### 2. other tags @@ -17499,6 +17522,176 @@ <table></table> !!end +!!test +Encapsulation properly handles null DSR information from foster box +!!options +parsoid=wt2html,wt2wt +!!input +{{echo|<table>foo<tr><td>bar</td></tr></table>}} +!!result +<span typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":" +<table>foo +<tr> +<td>bar</td></tr></table>"}},"i":0}}]}">foo</span> +<table> +<tbody> +<tr> +<td>bar</td></tr></tbody></table> +!!end + +!!test +1. Encapsulate foster-parented transclusion content +!!options +parsoid=wt2wt,wt2html +!!input +<table>{{echo|foo<tr><td>bar</td></tr>}}</table> +!!result +<span typeof="mw:Transclusion" data-mw="{"parts":[" +<table>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo +<tr> +<td>bar</td></tr>"}},"i":0}},"</table>"]}">foo</span> +<table> +<tbody> +<tr> +<td>bar</td></tr></tbody></table> +!!end + +!!test +2. Encapsulate foster-parented transclusion content +!!options +parsoid=wt2wt,wt2html +!!input +<table><div>{{echo|foo}}</div><tr><td>bar</td></tr></table> +!!result +<div typeof="mw:Transclusion" data-mw="{"parts":[" +<table> +<div>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo"}},"i":0}},"</div> +<tr> +<td>bar</td></tr></table>"]}">foo</div> +<table> +<tbody> +<tr> +<td>bar</td></tr></tbody></table> +!!end + +!!test +3. Encapsulate foster-parented transclusion content +!!options +parsoid=wt2wt,wt2html +!!input +<table><div><p>{{echo|foo</p></div><tr><td>}}bar</td></tr></table> +!!result +<div typeof="mw:Transclusion" data-mw="{"parts":[" +<table> +<div> +<p>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo</p></div> +<tr> +<td>"}},"i":0}},"bar</td></tr></table>"]}"> +<p>foo</p></div> +<table> +<tbody> +<tr> +<td>bar</td></tr></tbody></table> +!!end + +!!test +4. Encapsulate foster-parented transclusion content +!!options +parsoid=wt2wt,wt2html +!!input +<table><div><p>{{echo|foo</p></div><tr><td>}}bar</td></tr></table> +!!result +<div typeof="mw:Transclusion" data-mw="{"parts":[" +<table> +<div> +<p>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo</p></div> +<tr> +<td>"}},"i":0}},"bar</td></tr></table>"]}"> +<p>foo</p></div> +<table> +<tbody> +<tr> +<td>bar</td></tr></tbody></table> +!!end + +!!test +5. Encapsulate foster-parented transclusion content +!!options +parsoid=wt2wt,wt2html +!!input +<table><tr><td><div><p>{{echo|foo</p></div></td>foo}}</tr></table> +!!result +<span typeof="mw:Transclusion" data-mw="{"parts":[" +<table> +<tr> +<td> +<div> +<p>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo</p></div></td>foo"}},"i":0}},"</tr></table>"]}">foo</span> +<table> +<tbody> +<tr> +<td> +<div> +<p>foo</p></div></td></tr></tbody></table> +!!end + +!!test +6. Encapsulate foster-parented transclusion content +!!options +parsoid=wt2wt,wt2html +!!input +<table><tr><td><div><p>{{echo|foo</p></div></td>foo</tr></table>}}<p>ok</p> +!!result +<span typeof="mw:Transclusion" data-mw="{"parts":[" +<table> +<tr> +<td> +<div> +<p>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo</p></div></td>foo</tr></table>"}},"i":0}}]}">foo</span> +<table> +<tbody> +<tr> +<td> +<div> +<p>foo</p></div></td></tr></tbody></table> +<p>ok</p> +!!end + +!!test +7. Encapsulate foster-parented transclusion content +!!options +parsoid=wt2wt,wt2html +!!input +<table>{{echo|<p>foo</p>}}<td>bar</td></table> +!!result +<p typeof="mw:Transclusion" data-mw="{"parts":[" +<table>",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":" +<p>foo</p>"}},"i":0}}," +<td>bar</td></table>"]}">foo</p> +<table> +<tbody> +<tr> +<td>bar</td></tr></tbody></table> +!!end + +!!test +8. Encapsulate foster-parented transclusion content +!!options +parsoid=wt2wt,wt2html +!!input +{{echo|a +}}{|{{echo|style='color:red'}} +|- +|b +|} +!!result +<p typeof="mw:Transclusion" data-mw="{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a\n"}},"i":0}}]}">a</p><span typeof="mw:Transclusion" data-mw="{"parts":["{|",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"style":{"wt":"'color:red'"}},"i":0}},"\n|-\n|b\n|}"]}">{{{1}}}</span> +<table> +<tbody> +<tr> +<td>b</td></tr></tbody></table> +!!end + # ----------------------------------------------------------------- # The following section of tests are primarily to spec requirements # around serialization of new/edited content. @@ -17620,7 +17813,7 @@ #----------------------------- !! test -1. I/B qoute minimization: wikitext-only tags should be combined +1. I/B quote minimization: wikitext-only tags should be combined !! options parsoid=html2wt !! input @@ -17633,16 +17826,25 @@ '''A''B''''' '''A''BC''D''' + +'''''AB''''' + +'''''AB''''' + +'''''AB''''' !! result <p><i>A</i><i>B</i></p> <p><b>A</b><b>B</b></p> <p><i>A</i><b><i>B</i></b></p> <p><b>A</b><i><b>B</b></i></p> <p><b>A</b><i><b>B</b><b>C</b></i><b>D</b></p> +<p><i><b>A</b></i><i><b>B</b></i></p> +<p><i><b>A</b></i><b><i>B</i></b></p> +<p><b><i>A</i></b><i><b>B</b></i></p> !! end !! test -2. I/B qoute minimization: wikitext and html tags should not be combined +2. I/B quote minimization: wikitext and html tags should not be combined !! options parsoid=html2wt !! input @@ -17655,7 +17857,7 @@ !! end !! test -3. I/B qoute minimization: templated content stops minimization +3. I/B quote minimization: templated content stops minimization !! options parsoid=html2wt !! input @@ -17668,7 +17870,7 @@ !! end !! test -4. I/B qoute minimization: new content should be mimimized with adjacent old content +4. I/B quote minimization: new content should be mimimized with adjacent old content !! options parsoid=html2wt !! input -- To view, visit https://gerrit.wikimedia.org/r/87343 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iadc98cc4cc33c7725e5fbf4a16df7e1a898aee80 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Cscott <canan...@wikimedia.org> Gerrit-Reviewer: Subramanya Sastry <ssas...@wikimedia.org> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits