Page MenuHomePhabricator

Parsoid: named references in table ejects and duplicates content from the table
Closed, ResolvedPublic

Description

When editing [[The Legend of Korra (Book 2)]] in VE a reference from the table is ejected and duplicated on save, e.g. https://en.wikipedia.org/w/index.php?title=The_Legend_of_Korra_%28Book_2%29&diff=570312407&oldid=570187078

The problem appears to be some sort of interaction between something in the table and named references.
https://en.wikipedia.org/w/index.php?title=The_Legend_of_Korra_%28Book_2%29&diff=next&oldid=570389041
The earlier version in the above diff works correctly in VE, the later revision does not.

en.wp user GermanJoe reports that their sandbox testing this happens with any named ref in the table, and doesn't with unnamed references.

My own sandbox testing has been unable to reproduce it with a minimal table.
https://en.wikipedia.org/w/index.php?title=User:Thryduulf/sandbox&diff=570395879&oldid=570395501

My guess therefore is that its some sort of interaction issue.

It looks possibly related to bug 51217?


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=51217

Details

Reference
bz53402

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:53 AM
bzimport added a project: Parsoid-DOM.
bzimport set Reference to bz53402.

Oh, I have run into this before .. I documented this behavior in an earlier bug report .. if only I can remember how to find that report. Or maybe it was on the Feedback page?

IIRC, the problem is that the ProdCode parameter to Episode list is also used as the "id" HTML attribute value of a <td> cell in the template, either Episode list itself or other templates that Episode list uses. So, using anything else besides either a number of a string effectively breaks the HTML generated by the template. <td id="113<ref name="xyz" />"> no longer parses as a <td>. For some reason, the PHP parser is able to ignore the error (but once again IIRC, there was a minor HTML diff from the error, but I could be mistaken). But Parsoid's parse breaks more significantly because it becomes <td id="113<ref name=" and Parsoid is not able to recover from this gracefully.

Note that this only affects named parameters that use the same kind of quotes as the template that uses the ProdId parameter.

I would say that either the template needs fixing or users of Episode list template need to know about how that parameter is being used by the template and constraints on it.

It would be good if someone independently verifies this.

Correcting couple typos.

(In reply to comment #1)

besides either a number of a string effectively breaks the HTML generated by

... number *or* a string ...

Note that this only affects named parameters that use the same kind of quotes
as the template that uses the ProdId parameter.

... uses the *ProdCode* parameter ...

This is a problem with bad source wikitext -- I am going to close this as resolved-fixed for now. I've also examined the template and updated the WP:VE/F page here: https://en.wikipedia.org/w/index.php?title=Wikipedia%3AVisualEditor%2FFeedback&diff=570411578&oldid=570410348

Please reopen if anything is needed on the Parsoid end.