with a node.
## We won't likely support this unless this is really necessary.
!! test
Unsupported scenario: Cell combining with captions
!! options
parsoid=wt2html
!! wikitext
{|
|+class="foo"{{1x|{{!}}some caption}}
|bar
|}
!! html/php
!! html/parsoid
class="foo"| some caption |
bar |
!! end
!! test
Unsupported scenario: Templated cell merge with another templated cell
!! options
parsoid=wt2html
!! wikitext
{|
|{{1x|1=class="foo"}}{{1x|{{!}}foo}}
|}
!! html/php
!! html/parsoid
!! end
!! test
Merge tds in nested transclusion content (T52603)
!! wikitext
{{1x|}}
{|
|{{1x|{{!}} foo}}
|}
{{1x| }}
!! 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
!! 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=[[wikipedia:No Merging Here]] class="foo"}} baz
|-
|{{td_attrs_and_content|1=[[en:No Merging Here]] class="foo"}} baz
|-
|{{td_attrs_and_content|1=[[Category:No Merging Here]] class="foo"}} baz
|-
|{{td_attrs_and_content|1=[[File:Foobar.jpg]] class="foo"}} baz
|}
!! 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
!! article
Template:tdfoo
!! text
|| y
!! endarticle
# This test currently fails in Parsoid
!! test
Ensure td-cell-type is switched to th when the first cell in a row is a
!! wikitext
{|
!a||b
!c{{tdfoo}}
|}
!! html/php
!! html/parsoid
!! end
## ---------------------------------------------------------------------
## Semi-exhaustive list of tests for TableFixups::reparseWithPreviousell
## A bunch of these tests fail standalone mode, but pass integrated mode
## Those tests use html/parsoid+integrated sections only
## ---------------------------------------------------------------------
!! test
1. table-fixups td-td cell-combining: prev=single_pipe,no_attrs,no_content; cell=no_attrs
!! wikitext
{|
|{{1x|{{!}}y}}
|}
!! html/php
!! html/parsoid
!! end
## In standalone mode, Parsoid fails this test because the template parses as
## two cells instead of a single cell.
!! test
2. table-fixups td-td cell-combining: prev=single_pipe,no_attrs,no_content; cell=attrs
!! wikitext
{|
|{{1x|1={{!}}class='x'{{!}}y}}
|}
!! html/php
!! html/parsoid+integrated
!! end
!! test
3. table-fixups td-td cell-combining: prev=single_pipe,no_attrs,content; cell=no_attrs
!! wikitext
{|
| b {{1x|{{!}}y}}
|}
!! html/php
!! html/parsoid
!! end
!! test
4. table-fixups td-td cell-combining: prev=single_pipe,no_attrs,content; cell=attrs
!! wikitext
{|
| b {{1x|1={{!}}class='x'{{!}}y}}
|}
!! html/php
!! html/parsoid+integrated
| class='x'|y |
!! end
!! test
5. table-fixups td-td cell-combining: prev=single_pipe,attrs,no_content; cell=no_attrs
!! wikitext
{|
|title='a'|{{1x|{{!}}y}}
|}
!! html/php
!! html/parsoid
!! end
!! test
6. table-fixups td-td cell-combining: prev=single_pipe,attrs,no_content; cell=attrs
!! wikitext
{|
|title='a'|{{1x|1={{!}}class='x'{{!}}y}}
|}
!! html/php
!! html/parsoid+integrated
!! end
!! test
7. table-fixups td-td cell-combining: prev=single_pipe,attrs,content; cell=no_attrs
!! wikitext
{|
|title='a'| b {{1x|{{!}}y}}
|}
!! html/php
!! html/parsoid
!! end
!! test
8. table-fixups td-td cell-combining: prev=single_pipe,attrs,content; cell=attrs
!! wikitext
{|
|title='a'| b {{1x|1={{!}}class='x'{{!}}y}}
|}
!! html/php
!! html/parsoid+integrated
!! end
!! test
9. table-fixups td-td cell-combining: prev=double_pipe,no_content; cell=no_attrs
!! wikitext
{|
||{{1x|{{!}}y}}
|}
!! html/php
!! html/parsoid
!! end
!! test
10. table-fixups td-td cell-combining: prev=double_pipe,no_content; cell=attrs
!! wikitext
{|
||{{1x|1={{!}}class='x'{{!}}y}}
|}
!! html/php
!! html/parsoid+integrated
!! end
!! test
11. table-fixups td-td cell-combining: prev=double_pipe,content; cell=no_attrs
!! wikitext
{|
|| a {{1x|{{!}}y}}
|}
!! html/php
!! html/parsoid
!! end
!! test
12. table-fixups td-td cell-combining: prev=double_pipe,content; cell=attrs
!! wikitext
{|
|| a {{1x|1={{!}}class='x'{{!}}y}}
|}
!! html/php
!! html/parsoid+integrated
!! end
## These are the only interesting th-th combination scenarios that are different from td-td
!! test
1. table-fixups th-th cell-combining: cell=no-attrs
!! wikitext
{|
!{{1x|!y}}
|}
!! html/php
!! html/parsoid+integrated
!! html/parsoid+standalone
!! end
# NOTE: the whitespace in "! class='x'" is important
# because "!!class='x'" and ""!! class='x'"" parse differently.
# That seems like a bug in legacy (which Parsoid replicates).
!! test
2. table-fixups th-th cell-combining: cell=attrs
!! wikitext
{|
!{{1x|1=! class="x"{{!}}y}}
|}
!! html/php
!! html/parsoid+integrated
!! end
!! test
Templated cell not merging with previous cell with attributes and trailing vertical bar
!! wikitext
{|
| class="foo" |content|{{1x|{{!}}foo}}
|}
!! html/php
!! html/parsoid
!! end
!! test
Templated cell not merging with previous cell and trailing vertical bar
!! wikitext
{|
|[[Main Page]] content|{{1x|{{!}}foo}}
|}
!! html/php
!! html/parsoid
!! end
!! test
Templated cell not merging with previous cell and trailing vertical bar, attributes and row syntax
!! wikitext
{|
|one||[[two]]||three|{{1x|{{!}}four}}
|}
!! html/php
!! html/parsoid
!! end
!! test
Convert non-plaintext attributes to content
!! wikitext
{|
|test [http://google.com 123]|{{1x|{{!}}four}}
|}
!! html/php
!! html/parsoid
!! end
!! test
Convert multiple expanded attributes to content
!! wikitext
{|
|{{1x|title}}='a' class='234'|{{1x|{{!}}y}}
|title='{{1x|a}}'|{{1x|{{!}}y}}
|}
!! html/php
| title='a' class='234' |
y
|
title='a' |
y
|
!! html/parsoid
| title='a' class='234' | y |
title='a' | y |
!! end
!! test
Combine with a previous cell that follows fostered content
!! options
parsoid=wt2html
!! wikitext
{|
{{1x|{{!}}-}}
q
|{{1x|{{!}}test}}
|}
!! html/php
q
!! html/parsoid+integrated
q
!! end
!! test
Pipes in nowikis should suppress table fixups
!! options
parsoid=wt2html
!! wikitext
{|
|-
|foo||||bar
|-
|{{1x|foo||}}||bar
|}
!! html/php
!! html/parsoid
!! end
!! article
Template:Multi cell output
!! text
n2 || n3 || style="background:#9F9;" class="table-yes" | Yes
!! endarticle
!! article
Template:Multi cell output with empty cells
!! text
a |||| b
!! endarticle
!! test
Template emitting multi-cell output as plain content should be reparsed as multiple cells
!! wikitext
{|
| {{multi cell output}}
|}
!! html/php
!! html/parsoid
!! end
!! test
Attribute-suppressing content should not prevent multi-cell output split
!! wikitext
{|
| [[Main Page]] {{multi cell output}}
|}
!! html/php
!! html/parsoid
!! end
!! test
Empty cells should not prevent multi-cell output split
!! wikitext
{|
| [[Main Page]] {{multi cell output with empty cells}}
|}
!! html/php
!! html/parsoid
!! end
| |