Page MenuHomePhabricator

Difference in table row closing when switching from html to wikitext syntax cells
Open, Needs TriagePublic

Description

From https://prv-tests.wmcloud.org/diff/ruewiki/%D0%A1%D1%83%D0%B4%D0%B6%D0%B0 and many other pages on ruewiki since it's part of the infobox

λ (master) cat r
{|
<tr>
<td>asdasdf
|lkasjdf
</tr>
|}

λ (master) cat r | php maintenance/run parse
parse.php: warning: reading wikitext from STDIN. Press CTRL+D to parse.

<table>
<tbody><tr>
<td>asdasdf
</td></tr><tr>
<td>lkasjdf
</td></tr>
</tbody></table>
<p><br />
</p>

λ (master) cat r | php maintenance/run parse --parsoid
parse.php: warning: reading wikitext from STDIN. Press CTRL+D to parse.

<section data-mw-section-id="0" id="mwAQ"><table id="mwAg">
<tbody id="mwAw"><tr id="mwBA">
<td id="mwBQ">asdasdf</td>
<td id="mwBg">lkasjdf</td>
</tr>
</tbody></table>

</section>

However,

λ (master) cat s                                      
{|
<tr>
<td>asdasdf
<td>lkasjdf
</tr>
|}

λ (master) cat s | php maintenance/run parse         
parse.php: warning: reading wikitext from STDIN. Press CTRL+D to parse.

<table>
<tbody><tr>
<td>asdasdf
</td><td>lkasjdf
</td></tr>
<tr><td></td></tr></tbody></table>
<p><br />
</p>

λ (master) cat s | php maintenance/run parse --parsoid
parse.php: warning: reading wikitext from STDIN. Press CTRL+D to parse.

<section data-mw-section-id="0" id="mwAQ"><table id="mwAg">
<tbody id="mwAw"><tr id="mwBA">
<td id="mwBQ">asdasdf</td>
<td id="mwBg">lkasjdf</td>
</tr>
</tbody></table>

</section>

Event Timeline

ssastry subscribed.

No, this is busted - Parsoid is doing the right thing. Let us fix the template.

From the ukwiki example,

{|
|-
<tr class=""><td colspan="5" class="" style="text-align:center; ">
| colspan="2" |<span class="anchor" id="map-osm"></span><mapframe width=300 height=300 zoom=12 latitude=52.048888888889 longitude=26.4 align=center frameless>[{"type": "ExternalData","service": "geoshape","ids": "Q21659348","properties": {"fill-opacity": 0.3}}]</mapframe></td></tr></tr>
</tr>
</tr>
|}

Maybe add a lint for "mixing wikitext and table syntax" to make it clear this is considered not a good thing to do?

Maybe add a lint for "mixing wikitext and table syntax" to make it clear this is considered not a good thing to do?

I made that suggestion slightly buried in T322775#8385044.

The nibbling around that idea might make this a duplicate of the ancient T48300: Handle mixed wikitext / html tables consistently.