!! Version 2
#
# This file will hold tests for table fixup dom handlers.
# For now, we are only adding tests for unsupported scenarios here.
# Eventually, once the monolithic parser test file is split up,
# all table fixup tests will move here.
!! article
Template:1x
!! text
{{{1}}}
!! endarticle
!! article
Template:td_class
!! text
class="foo"
!! endarticle
!! article
Template:td_content
!! text
| foobar
!! endarticle
!! article
Template:td_attrs_and_content
!! text
{{{1}}} | foobar
!! endarticle
!! article
Template:td_attrs_and_content_with_newlines
!! text
class="foo" | foobar
baz
!! endarticle
!! article
No Merging Here
!! text
Dummy article to suppress redlinks in tests
!! end
!! test
Unsupported scenario: Cell combining with captions
!! options
parsoid=wt2html
!! wikitext
{|
|+class="foo"{{1x|1={{!}}some caption}}
|bar
|}
!! html/php
!! html/parsoid
class="foo"some caption |
bar |
!! end
!! test
Unsupported scenario: Templated cell cannot merged with another templated cell
!! options
parsoid=wt2html
!! wikitext
{|
|{{1x|1=class="foo"}}{{1x|1={{!}}foo}}
|}
!! html/php
!! html/parsoid
!! end
!! test
Unsupported scenario: Templated cell with attributes cannot combine with previous cell
!! options
parsoid=wt2html
!! wikitext
{|
|class="foo"{{1x|1={{!}}title="foo"{{!}}foo}}
|}
!! html/php
!! html/parsoid
class="foo" | title="foo" | foo |
!! end
!! test
Unsupported scenario: Templated cell cannot combine with previous cell with attributes
!! options
parsoid=wt2html
!! wikitext
{|
|class="foo"|title="foo"{{1x|1={{!}}foo}}
|}
!! html/php
!! html/parsoid
!! end
!! test
Table cell attributes and content from multiple templates
!! wikitext
{|
|-
| {{td_class}} {{td_attrs_and_content|1=style='border:1px solid blue'}} baz
|}
!! html/php
!! html/parsoid
!! end
!! test
Table cell attribute merging edge cases
!! config
wgParserEnableLegacyMediaDOM=false
!! wikitext
{|
| {{td_attrs_and_content|1=foo
class="foo"}} baz
|-
|{{td_attrs_and_content|1=[[No Merging Here]] class="foo"}} baz
|-
|{{td_attrs_and_content|1=[[File:Foo.jpg]] class="foo"}} baz
|}
!! html/php
!! html/parsoid
!! end
!! test
Fixup of interrupted table-cell parsing because of multi-line transclusion
!! wikitext
{|
! class="c1" | Col 1 !! class="c2" |{{1x|
1=Col 2}} !! class="c3" | Col 3 !! class="c4" | Col 4
|}
!! html/php
!! html/parsoid
!! end
!! test
Ensure newlines in collected attribute doesn't trip up reparsing
!! wikitext
{|
|rowspan="1" {{td_attrs_and_content_with_newlines}}
|}
!! html/php
!! html/parsoid
!! end
!! test
Ensure a cell with newlines doesn't combine with following cell
!! wikitext
{|
|-
| combined-and-lost {{td_content|}}
|-
|not combined
{{td_content|}}
|}
!! html/php
foobar
|
not combined
|
foobar
|
!! html/parsoid
foobar |
not combined
| foobar |
!! end
!! test
Table cell attributes and nested transclusions
!! wikitext
{|
| '''{{td_attrs_and_content|1=style='border:1px solid blue;'}}'''
|}
!! html/php
!! html/parsoid
!! end
!! test
T331486: Newline entities should be properly handled while fixing up table cells
!! wikitext
{|
|{{td_attrs_and_content|1=title="a
b" class="xyz"}}
|}
!! html/php
!! html/parsoid
!! end