Page MenuHomePhabricator

TableFixups handler: Unhandled table-attribute reparse scenarios
Closed, ResolvedPublic

Description

{|
| {{flag|Germany}} || {{N/A}}
| {{flag|Germany}} || {{1x|1=data-style="border:1px solid red"{{!}}x{{!}}{{!}}}} {{N/A}}
| {{flag|Germany}} || {{1x|1=data-style="border:1px solid red"}} {{N/A}} <!-- SCENARIO 1: THIS IS NOT HANDLED -->
|}

This is a gap in the TableFixups handler which attempts to "collect" strings from unparsed template strings, reparse them via the tokenizer and update the attributes.

For scenario 1, the failure is because the 2 separate transclusions {{1x|..}} and {{N/A}} produce different attributes of the same HTML element (table cell). We need to update the data-mw representation for this case. The existing parts representation might suffice. But, right now, because of this representation gap, the handler aborts with [error/dom/tdfixup] Unhandled TD-fixup scenario. Encountered multiple transclusion children of a <td> error message.

Bonus points:
The original bug report used the following test case for Scenario 1.

{|
| {{flag|Germany}} || {{nts|0}} {{N/A}}
|}

This test case introduces an addition quirk where the {{nts|0}} generates a string that is an invalid table attirbute string (it generates a <span ..>...</span>) that should be simply ignored.

Event Timeline

ssastry raised the priority of this task from to Medium.
ssastry updated the task description. (Show Details)
ssastry added a project: Parsoid.
ssastry added a subscriber: ssastry.
ssastry renamed this task from Add support for unhandled error/dom/tdfixup scenarios -- known issue being logged for action to TableFixups handler: Unhandled table-attribute reparse scenarios.Jun 29 2020, 11:03 PM
ssastry updated the task description. (Show Details)
ssastry added subscribers: Arlolra, revi.
ssastry added subscribers: AdHuikeshoven, Elitre.

Change 627581 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/services/parsoid@master] WIP: Get rid of incorrect assumptions from TableFixups

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

Change 627581 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Get rid of incorrect assumptions from TableFixups

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

Change 644393 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.13.0-a18

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

Change 644221 had a related patch set uploaded (by C. Scott Ananian; owner: Subramanya Sastry):
[mediawiki/vendor@wmf/1.36.0-wmf.20] Bump wikimedia/parsoid to 0.13.0-a18

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

Change 644393 merged by jenkins-bot:
[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.13.0-a18

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

Change 644221 merged by jenkins-bot:
[mediawiki/vendor@wmf/1.36.0-wmf.20] Bump wikimedia/parsoid to 0.13.0-a18

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