Make non-existent messages be html safe regardless of output format
[lhc/web/wiklou.git] / tests / parser / parserTests.txt
index 2f5450c..be9ccaf 100644 (file)
@@ -7083,11 +7083,12 @@ parsoid=wt2html
 !! end
 
 !! test
-Strip unsupported table tags
+Strip unsupported table tags, but introduce row wikitext as required
 !! options
 parsoid=html2wt
 !! html/parsoid
 <table>
+<caption>Test</caption>
 <thead>
 <tr>
 <th>Month</th>
@@ -7113,10 +7114,12 @@ parsoid=html2wt
 </table>
 !! wikitext
 {|
+|+Test
 
 !Month
 !Savings
 
+|-
 |January
 |$100
 
@@ -7124,10 +7127,31 @@ parsoid=html2wt
 |February
 |$80
 
+|-
 |Sum
 |$180
 
 |}
+!! html/php+tidy
+<table>
+<caption>Test</caption>
+<tr>
+<th>Month</th>
+<th>Savings</th>
+</tr>
+<tr>
+<td>January</td>
+<td>$100</td>
+</tr>
+<tr>
+<td>February</td>
+<td>$80</td>
+</tr>
+<tr>
+<td>Sum</td>
+<td>$180</td>
+</tr>
+</table>
 !! end
 
 !! test
@@ -7170,6 +7194,129 @@ parsoid={
 |}
 !!end
 
+!! test
+Testing selser after addition of new row before first row (T125419)
+!! options
+parsoid={
+  "modes": ["wt2wt", "selser"],
+  "changes": [
+    [ "tr", "before", "<tr><td>X</td></tr>" ]
+  ]
+}
+!! wikitext
+{|
+|a
+|}
+!! wikitext/edited
+{|
+|X
+|-
+|a
+|}
+!! end
+
+!! test
+Serialize new table rows in a HTML table using HTML tags
+!! options
+parsoid={
+  "modes": ["wt2wt", "selser"],
+  "changes": [
+    [ "tr", "before", "<tr><td>X</td></tr>" ]
+  ]
+}
+!! wikitext
+<table><tr><td>a</td></tr></table>
+!! wikitext/edited
+<table><tr><td>X</td></tr><tr><td>a</td></tr></table>
+!! end
+
+!! test
+Serialize new table cells in a HTML row using HTML tags
+!! options
+parsoid={
+  "modes": ["wt2wt", "selser"],
+  "changes": [
+    [ "td", "before", "<td>X</td>" ]
+  ]
+}
+!! wikitext
+<table><tr><td>a</td></tr></table>
+!! wikitext/edited
+<table><tr><td>X</td><td>a</td></tr></table>
+!! end
+
+!! test
+Wikitext tables can be nested inside HTML tables
+!! options
+parsoid=html2wt
+!! html
+<table data-parsoid='{"stx":"html"}'>
+<tr><td>
+<table>
+<tr><td>foo</td></tr>
+</table>
+</td></tr>
+</table>
+!! wikitext
+<table>
+<tr><td>
+{|
+|foo
+|}
+</td></tr>
+</table>
+!! end
+
+!! test
+Serialize wikitext list items as HTML list items when embedded in a HTML list
+!! options
+parsoid=html2wt
+!! html
+<ul data-parsoid='{"stx": "html"}'>
+<li data-parsoid='{}'>a</li>
+<li>b</li>
+</ul>
+!! wikitext
+<ul>
+<li>a</li>
+<li>b</li>
+</ul>
+!! end
+
+# SSS FIXME: Is this actually a good thing given the
+# odd nested list output that is generated by MW?
+# <ul><li>foo<ul>..</ul></li></ul> instead of
+# <ul><li>foo</li><ul>..</ul></ul>
+!! test
+Wikitext lists can be nested inside HTML lists
+!! options
+parsoid=html2wt
+!! html
+<ul data-parsoid='{"stx": "html"}'>
+<li data-parsoid='{"stx": "html"}'>a
+<ul><li>b</li></ul>
+</li>
+</ul>
+
+<ul data-parsoid='{"stx": "html"}'>
+<li>x
+<ul><li>y</li></ul>
+</li>
+</ul>
+!! wikitext
+<ul>
+<li>a
+* b
+</li>
+</ul>
+
+<ul>
+<li>x
+* y
+</li>
+</ul>
+!! end
+
 ###
 ### Internal links
 ###
@@ -9797,7 +9944,7 @@ Magic Word: {{NUMBEROFFILES}}
 !! wikitext
 {{NUMBEROFFILES}}
 !! html
-<p>6
+<p>7
 </p>
 !! end
 
@@ -10866,7 +11013,7 @@ int keyword - non-existing message
 !! wikitext
 {{int:var}}
 !! html
-<p>&lt;var&gt;
+<p>⧼var⧽
 </p>
 !! end
 
@@ -20666,7 +20813,6 @@ this is not the the title
 !! html/php
 Screen
 <p>this is not the the title
-<span class="error"><strong>Warning:</strong> Display title "whatever" was ignored since it is not equivalent to the page's actual title.</span>
 </p>
 !! end