Page MenuHomePhabricator

Minor table fixup rendering diff from pipe in table row attribute position
Closed, ResolvedPublic

Description

From https://sl.wikipedia.org/wiki/Svetovno_prvenstvo_v_nogometu_1974

{|
|- style=font-size:85%|0 – 2 
| hi
|}

Legacy

<table>

<tbody><tr style="font-size:85%&#124;0">
<td>hi
</td></tr></tbody></table>

Parsoid

<table id="mwAg">
<tbody id="mwAw"><tr style="font-size:85%" id="mwBA"> 
<td id="mwBQ">hi</td></tr>
</tbody></table>

Event Timeline

I am inclined to decline this as an edge-case wont-fix, and even Parsoid is accidentally doing what the user intended, we can take it and let it be?

I'm not sure the user's intention should be our guide here since they seem to want 0 – 2 to be content of something

Pipe is a valid character to be part of a table row attribute. What if you wanted to do

{|
|- data-something="test|123"
| hi
|}

I think it's at least worth looking at the grammar to see if it's an easy fix

Fair enough.

The example wikitext |- style=font-size:85%|0 – 2 probably wants to be

|- style=font-size:85%
|0 – 2

indicating a small score line. I think

Pipe is a valid character to be part of a table row attribute.

Would definitely be the edge case view and that at least people should be required to mark up intentional | to be inside quotation marks or template syntax when on the same line as a |-, with the option to emit a lint elsewise. IDK how much work that is. (Exemplary search that returns some 5.5k pages and a timeout where I caught the template and other double/triple-curly-bracket context as a second reason.)

(Exemplary search that returns some 5.5k pages and a timeout where I caught the template and other double/triple-curly-bracket context as a second reason.)

I was curious to see how this was being used and found a page I found a non-template "|" use. That itself turned out to be not interesting, but I found a totally unrelated bug on that page! :-) https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/1193288 ..

Change #1238378 had a related patch set uploaded (by OSleger; author: OSleger):

[mediawiki/services/parsoid@master] Grammar: Allow pipe in table attribute value

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

Change #1239697 had a related patch set uploaded (by OSleger; author: OSleger):

[mediawiki/services/parsoid@master] Grammar: Allow pipe in table attribute value

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

Change #1238378 abandoned by OSleger:

[mediawiki/services/parsoid@master] Grammar: Allow pipe in table attribute value

Reason:

Incident duplicate

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

Change #1239697 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Grammar: Allow pipe in table attribute value

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

Change #1247655 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

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

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

Change #1247655 abandoned by C. Scott Ananian:

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

Reason:

Fails serialization compatibility tests

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