aboutsummaryrefslogtreecommitdiffstats
path: root/tests/parser/tables.txt
diff options
context:
space:
mode:
authorIsabelle Hurbain-Palatin <ihurbainpalatin@wikimedia.org>2024-06-07 09:02:13 +0200
committerIsabelle Hurbain-Palatin <ihurbainpalatin@wikimedia.org>2024-06-07 09:06:26 +0200
commit36132fc91ba8441364761734022d97a22e85c147 (patch)
tree7e34a116cccffff1a5c8fc3a33c03ad5297aec79 /tests/parser/tables.txt
parent54b5c3ff96c0326de2811a334ec9ef0b05366005 (diff)
downloadmediawikicore-36132fc91ba8441364761734022d97a22e85c147.tar.gz
mediawikicore-36132fc91ba8441364761734022d97a22e85c147.zip
Sync up core repo with Parsoid
This now aligns with Parsoid commit 2b45686645a87155cb6148e295f5a67f29f261c8 Change-Id: I75ea7f96548033edd2f3925b5ecf2db9cf6bcbb0
Diffstat (limited to 'tests/parser/tables.txt')
-rw-r--r--tests/parser/tables.txt31
1 files changed, 28 insertions, 3 deletions
diff --git a/tests/parser/tables.txt b/tests/parser/tables.txt
index 76acd00381bb..29bf6e5cdc7c 100644
--- a/tests/parser/tables.txt
+++ b/tests/parser/tables.txt
@@ -900,8 +900,11 @@ parsoid={
</td></tr></tbody></table>
!! end
+# This test introduces a newline in a fosterable position which tangentially
+# tests template-wrapping behavior more explicitly tested by the # next test
+# ("2b: Delete ...").
!! test
-2. Template-generated table cell attributes and cell content
+2a. Template-generated table cell attributes and cell content
!! wikitext
{|
|{{table_attribs_2}}
@@ -916,8 +919,30 @@ parsoid={
</td></tr></tbody></table>
!! html/parsoid
<table>
-<tbody><tr><td about="#mwt1" typeof="mw:Transclusion" data-sort-value="" style="color:red;" data-mw='{"parts":["|",{"template":{"target":{"wt":"table_attribs_2","href":"./Template:Table_attribs_2"},"params":{},"i":0}}]}'>Foo</td>
-<td about="#mwt1">Bar</td><td about="#mwt1">Baz</td></tr>
+<tbody><tr><td about="#mwt1" typeof="mw:Transclusion" data-sort-value="" style="color:red;" data-mw='{"parts":["|",{"template":{"target":{"wt":"table_attribs_2","href":"./Template:Table_attribs_2"},"params":{},"i":0}}]}'>Foo</td><td about="#mwt1">Bar</td><td about="#mwt1">Baz</td></tr>
+</tbody></table>
+!! end
+
+!! test
+2b: Delete whitespace/comments if found in fosterable position while template-wrapping
+!! options
+!! wikitext
+<table>
+<tr>
+<td>hi</td>
+{{1x|<td>ho</td>
+<!--comment-->
+<td>hi</td>}}
+<td>ho</td>
+</tr>
+</table>
+!! html/parsoid
+<table data-parsoid='{"stx":"html"}'>
+<tbody><tr>
+<td data-parsoid='{"stx":"html"}'>hi</td>
+<td about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"&lt;td>ho&lt;/td>\n&lt;!--comment-->\n&lt;td>hi&lt;/td>"}},"i":0}}]}'>ho</td><td about="#mwt1">hi</td>
+<td>ho</td>
+</tr>
</tbody></table>
!! end