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
## FIXME:Same as "6. table-fixups td-td cell-combining: prev=single_pipe,attrs,no_content; cell=attrs"
## This test fails in standalone mode and hence marked +integrated only
!! test
Templated cell with attributes merging with previous cell
!! options
parsoid=wt2html
!! wikitext
{|
|class="foo"{{1x|1={{!}}title="foo"{{!}}foo}}
|}
!! html/php
!! html/parsoid+integrated
!! end
## FIXME:Same as "7. table-fixups td-td cell-combining: prev=single_pipe,attrs,content; cell=no_attrs"
!! test
Templated cell merging with previous cell with attributes
!! wikitext
{|
|class="foo"|title="foo"{{1x|{{!}}foo}}
|}
!! html/php
!! html/parsoid
!! end
## FIXME:Same as "1. table-fixups td-td cell-combining: prev=single_pipe,no_attrs,no_content; cell=no_attrs"
!! test
Merge tds (T52603)
!! wikitext
{|
|{{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
!! 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=[[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: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.1!! class="c2" |{{1x|
1=Col 1.2}}!! class="c3" |Col 1.3!! class="c4" |Col 1.4
! class="d1" |Col 2.1!! class="d2" |{{1x|
1=Col 2.2}}!! class="d3" |Col 2.3! abcd!! class="d4" |Col 2.4
| class="e1" |Col 3.1|| class="e2" |{{1x|
1=Col 3.2}}|| class="e3" |Col 3.3| abcd|| class="e4" |Col 3.4
|}
!! html/php
Col 1.1 |
Col 1.2 |
Col 1.3 |
Col 1.4
|
Col 2.1 |
Col 2.2 |
Col 2.3! abcd |
Col 2.4
|
Col 3.1 |
Col 3.2 |
Col 3.3| abcd |
Col 3.4
|
!! html/parsoid
Col 1.1 | Col 1.2 | Col 1.3 | Col 1.4 |
Col 2.1 | Col 2.2 | Col 2.3! abcd | Col 2.4 |
Col 3.1 | Col 3.2 | Col 3.3| abcd | Col 3.4 |
!! 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
!! 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
| |