#
# You can also set the following parser properties via test options:
# wgEnableUploads, wgAllowExternalImages, wgMaxTocLevel,
-# wgLinkHolderBatchSize, wgRawHtml
+# wgLinkHolderBatchSize, wgRawHtml, wgInterwikiMagic
#
# For testing purposes, temporary articles can created:
# !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle
!! test
Table with row followed by newlines and table heading
+!! options
+parsoid=wt2html,html2html
!! wikitext
{|
|-
! foo
|}
-!! html
+!! html/*
<table>
!! test
Table with empty line following the start tag
+!! options
+parsoid=wt2html,html2html
!! wikitext
{|
|-
| foo
|}
-!! html
+!! html/*
<table>
</tbody></table>
!! end
+# T137406: Whitespace in the HTML
!! test
-Strip unsupported table tags, but introduce row wikitext as required
+1. Generate correct wikitext for tables with thead/tbody/tfoot
!! options
parsoid=html2wt
!! html/parsoid
!! wikitext
{|
|+Test
-
!Month
!Savings
-
|-
|January
|$100
-
|-
|February
|$80
-
|-
|Sum
|$180
-
|}
!! html/php+tidy
<table>
</table>
!! end
+# T137406: No whitespace in the HTML
+!! test
+2. Generate correct wikitext for tables with thead/tbody/tfoot
+!! options
+parsoid=html2wt
+!! html/parsoid
+<table><thead><tr><th>heading</th></tr></thead><tbody><tr><td>foo</td></tr></tbody></table>
+!! wikitext
+{|
+!heading
+|-
+|foo
+|}
+!! end
+
!! test
Testing serialization after deletion in references
!! options
!! test
Interlanguage link
-!! options
-parsoid=wt2html,wt2wt,html2html
!! wikitext
Blah blah blah
[[zh:Chinese]]
<link rel="mw:PageProp/Language" href="http://zh.wikipedia.org/wiki/Chinese"/>
!! end
+## parsoid html2wt will lose the space variations
!! test
Interlanguage link with spacing
!! options
!! test
Double interlanguage link
-!! options
-parsoid=wt2html,wt2wt,html2html
!! wikitext
Blah blah blah
[[es:Spanish]]
<link rel="mw:PageProp/Language" href="http://zh.wikipedia.org/wiki/Chinese"/>
!! end
+## parsoid html2wt will lose the space variations
!! test
Interlanguage link variations
!! options
<link rel="mw:PageProp/Language" href="http://es.wikipedia.org/wiki/Foo_bar" />
!! end
+## parsoid html2wt will normalize the space to _
!! test
Space and question mark encoding in interlanguage links (T95473)
!! options
<link rel="mw:PageProp/Language" title="Multilingual" href="http://wikisource.org/wiki/Article"/>
!! end
+## PHP parser tests script needs an update
+## Parsoid html2wt will normalize output to [[:zh:Chinese]]
+!! test
+Language links render as inline links if $wgInterwikiMagic=false
+!! options
+wgInterwikiMagic=false
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+Blah blah blah
+[[zh:Chinese]]
+!! html/parsoid
+<p>Blah blah blah <a rel="mw:ExtLink" href="http://zh.wikipedia.org/wiki/Chinese" title="zh:Chinese">zh:Chinese</a></p>
+!! end
+
+## PHP parser tests script needs an update
+## Parsoid html2wt will normalize output to [[:zh:Chinese]]
+!! test
+Language links render as inline links in the Talk namespace
+!! options
+title=Talk:Foo
+parsoid=wt2html,wt2wt,html2html
+!! wikitext
+Blah blah blah
+[[zh:Chinese]]
+!! html/parsoid
+<p>Blah blah blah <a rel="mw:ExtLink" href="http://zh.wikipedia.org/wiki/Chinese" title="zh:Chinese">zh:Chinese</a></p>
+!! end
+
!! test
Parsoid-specific test: Wikilinks with should RT properly
!! options
parsoid=html2wt
!! html/*
<table>
-
<tr>
<td>foo!!bar
</td></tr></table>
!! wikitext
{|
-
|foo!!bar
|}
!! end
parsoid=html2wt
!! html/*
<table>
-
<tr>
<th>foo!bar
</th></tr></table>
!! wikitext
{|
-
!foo!bar
|}
!! end
parsoid=html2wt
!! html/*
<table>
-
<tr>
<th>-bar
</th></tr>
!! wikitext
{|
-
!-bar
-
|-
|<nowiki>-bar</nowiki>
|}
parsoid=html2wt
!! html/*
<table>
-
<tr>
<th>+bar
</th></tr>
!! wikitext
{|
-
!+bar
-
|-
|<nowiki>+bar</nowiki>
|}
</references>
!! end
+!! test
+DOMDiff: Edits to content nested in elements with templated attributes should not be lost (T139388)
+!! options
+parsoid={
+ "modes": ["selser"],
+ "changes": [
+ [ "div:first-child", "text", "bar" ]
+ ]
+}
+!! wikitext
+<div style="{{1x|color:red;}}%">foo</div>
+!! wikitext/edited
+<div style="{{1x|color:red;}}%">bar</div>
+!! end
+
!! test
Empty LI (T49673)
!! wikitext
!! html/php+tidy
<ul>
<li>a</li>
-<li class="mw-empty-li"></li>
-<li class="mw-empty-li"></li>
+<li class="mw-empty-elt"></li>
+<li class="mw-empty-elt"></li>
<li>b</li>
</ul>
!! end