Page MenuHomePhabricator

In the preview, the table syntax is processed even if it is inside nowiki
Closed, ResolvedPublic

Description

When there is a "|" inside the nowiki tag in the text inside a table cell, this "|" is still recognized as part of the wiki markup

{| class="standard"
| <code><nowiki>{{ACB|PG}}</nowiki></code>
|}

in the preview in the editor-2017 it looks this (there is no code tag and the second "|" is recognized as part of the table cell )

PG}}

Screenshot 2021-04-11 at 20-41-51 Шаблон ACB doc — Википедия.png (108×107 px, 1 KB)

but in the preview in the editor-2010 and after saving it can be seen normally

{{ACB|PG}}

Screenshot 2021-04-11 at 20-48-57 Шаблон ACB doc — Википедия.png (111×124 px, 1 KB)

https://ru.wikipedia.org/wiki/Шаблон:ACB/doc

Event Timeline

matmarex added a subscriber: matmarex.

2017 wikitext editor uses Parsoid for previews. The normal Parsoid rendering of the page has the same problem: https://ru.wikipedia.org/api/rest_v1/page/html/Шаблон%3AACB%2Fdoc

Arlolra triaged this task as Medium priority.Apr 15 2021, 5:25 PM
Arlolra moved this task from Needs Triage to Bugs & Crashers on the Parsoid board.
Arlolra added a subscriber: Arlolra.

No. it is not. https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/677976 will fix this issue very likely.

That patch was about breaking on | in xmlish attributes. Here it's in the content, so something different. The tokenization seems fine. The problem is that the TableFixups pass is traversing into extension/nowiki content, which is a no-no.

echo -e "{|\n| <code><nowiki>{{ACB|PG}}</nowiki></code>\n|}" | php bin/parse.php --dump dom:pre-fixups,dom:post-fixups
----- DOM: pre-fixups -----
<body data-parsoid='{"tmp":{},"dsr":[0,49,0,0]}'><table data-parsoid='{"tsr":[0,2],"tmp":{"tagId":1},"dsr":[0,48,2,2]}'>
<tbody data-parsoid='{"tmp":{},"dsr":[3,46,0,0]}'><tr data-parsoid='{"tmp":{},"autoInsertedEnd":true,"autoInsertedStart":true,"dsr":[3,45,0,0]}'><td data-parsoid='{"tsr":[3,4],"tmp":{"noAttrs":true,"tagId":2},"autoInsertedEnd":true,"dsr":[3,45,1,0]}'> <code data-parsoid='{"tsr":[5,11],"stx":"html","tmp":{"tagId":3},"dsr":[5,45,6,7]}'><span typeof="mw:Nowiki" data-parsoid='{"tmp":{},"dsr":[11,38,8,9]}'>{{ACB|PG}}</span></code></td></tr>
</tbody></table>
</body>

---------------------------

----- DOM: post-fixups -----
<body data-parsoid='{"tmp":{},"dsr":[0,49,0,0]}'><table data-parsoid='{"tsr":[0,2],"tmp":{"tagId":1},"dsr":[0,48,2,2]}'>
<tbody data-parsoid='{"tmp":{},"dsr":[3,46,0,0]}'><tr data-parsoid='{"tmp":{},"autoInsertedEnd":true,"autoInsertedStart":true,"dsr":[3,45,0,0]}'><td data-parsoid='{"tsr":[3,4],"tmp":{"noAttrs":true,"tagId":2},"autoInsertedEnd":true,"dsr":[3,45,1,0]}'>PG}}</td></tr>
</tbody></table>
</body>

----------------------------

<table data-parsoid='{"dsr":[0,48,2,2]}'>
<tbody data-parsoid='{"dsr":[3,46,0,0]}'><tr data-parsoid='{"autoInsertedStart":true,"dsr":[3,45,0,0]}'><td data-parsoid='{"dsr":[3,45,1,0]}'>PG}}</td></tr>
</tbody></table>

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

[mediawiki/services/parsoid@master] [WIP] Fix collecting attributish content in table fixups

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

Change 679906 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Fix collecting attributish content in table fixups

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

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

[mediawiki/vendor@master] Bump wikimedia/parsoid to v0.14.0-a1

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

Change 682690 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.14.0-a1 for MW 1.37

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

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

[mediawiki/core@REL1_36] composer: Lock Parsoid version to specific 0.13.0 release

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

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

[mediawiki/vendor@REL1_36] Bump wikimedia/parsoid to "release version" 0.13.0

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

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

[mediawiki/vendor@REL1_36] Bump wikimedia/parsoid to "release version" 0.13.0

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

Change 693972 abandoned by C. Scott Ananian:

[mediawiki/vendor@REL1_36] Bump wikimedia/parsoid to "release version" 0.13.0

Reason:

in favor of I2bfdd568ba24489830fb0d6799524058b3b6d65f

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

Change 693971 merged by Jforrester:

[mediawiki/vendor@REL1_36] Bump wikimedia/parsoid to "release version" 0.13.0

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

Change 693970 merged by jenkins-bot:

[mediawiki/core@REL1_36] composer: Lock Parsoid version to specific 0.13.0 release

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