Page MenuHomePhabricator

TableFixups edge case (affecting some template namespace pages on several wikis)
Closed, ResolvedPublic

Description

Consider this wikitext:

{|
|x
|| <code>bold=yes<wbr/>|code=yes</code>
|}

{{1x|1=
{{{!}}
{{!}}x
{{!}}{{!}} <code>bold=yes<wbr/>{{!}}code=yes</code>
{{!}}}
}}

Parsoid's wt2htmls emit this (normalized to remove unnecessary attributes):

<table>
<tbody><tr><td>x</td>
<td><code>bold=yes<wbr/>|code=yes</code></td></tr>
</tbody></table>

<span about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1","named":true,"spc":["","","\n","\n"]}]],"dsr":[50,133,null,null]}' data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"{{{!}}\n{{!}}x\n{{!}}{{!}} &lt;code>bold=yes&lt;wbr/>{{!}}code=yes&lt;/code>\n{{!}}}"}},"i":0}}]}'>
</span><table about="#mwt1">
<tbody><tr><td>x</td>
<td>code=yes</td></tr>
</tbody></table>

So, tablefixups is treating the content before the | as attributes incorrectly.

Event Timeline

{{1x|1=
{{{!}}
{{!}}x
{{!}}{{!}} bold=yes{{!}}code=yes
{{!}}}
}}

is enough to reproduce the issue.

Change #1240363 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):

[mediawiki/services/parsoid@master] WIP: TableFixups: Fix edge case in attribute reparsing

https://gerrit.wikimedia.org/r/1240363

Change #1240363 abandoned by Subramanya Sastry:

[mediawiki/services/parsoid@master] TableFixups: Fix edge case in attribute reparsing

Reason:

Abandoning .. Arlo and I had a long review session and the TLDR of it is that I was interpreting the NO_ATTRS as a semantic property independent of syntax, and Arlo was pointing out that I had introduced that flag in my previous work as a syntactic marker, whether "|" was used as an attribute delineator. A lot of our gerrit back-and-forth confusion was based on this distinction. Arlo convinced me to retain the syntactic meaning and he is going to submit a followup patch to use that flag and other existing information to derive the same information I was introduced a new flag for. In a followup, to avoid this confusion, we'll rename the NO_ATTRS flag to clarity it is recording syntactic info, not semantic info.

https://gerrit.wikimedia.org/r/1240363

Change #1240363 restored by Arlolra:

[mediawiki/services/parsoid@master] TableFixups: Fix edge case in attribute reparsing

https://gerrit.wikimedia.org/r/1240363

Change #1240363 merged by jenkins-bot:

[mediawiki/services/parsoid@master] TableFixups: Fix edge case in attribute reparsing

https://gerrit.wikimedia.org/r/1240363

Change #1247162 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.23.0-a19

https://gerrit.wikimedia.org/r/1247162

Change #1247162 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.23.0-a19

https://gerrit.wikimedia.org/r/1247162