Page MenuHomePhabricator

Incorrect transclusion handling on a specific page (caused by included page beginning with a comment?)
Open, MediumPublic

Assigned To
Authored By
Aug 17 2020, 1:51 PM
Referenced Files
F32186600: image.png
Aug 17 2020, 2:02 PM
F32186595: image.png
Aug 17 2020, 2:00 PM
F32186593: image.png
Aug 17 2020, 2:00 PM
F32186597: image.png
Aug 17 2020, 2:00 PM
F32186582: image.png
Aug 17 2020, 1:51 PM
F32186571: image.png
Aug 17 2020, 1:51 PM
F32186581: Wikipedie_Diskuse o smazání_seznam.html
Aug 17 2020, 1:51 PM
F32186573: image.png
Aug 17 2020, 1:51 PM


originally reported here:

DiscussionTools' reply widget doesn't open in the first section ("Hana Krampolová") on this page:ání/seznam

Opening it in VE, something immediately looks wrong, as the text of the next section is directly editable, even though it should be part of a transclusion:ání/seznam?veaction=edit

image.png (2×3 px, 618 KB)

…and the section itself has the expected transclusion syntax for the next section as a part of its "content":

image.png (2×3 px, 814 KB)

The Parsoid rendering for the page is here:ání%2Fseznam/18926832?redirect=false&stash=true

The nodes belonging to the broken transclusion are marked with about="#mwt5", but the "initial" node (which would have the typeof="mw:Transclusion" attribute etc.) is missing.

The section node is actually correctly marked as a transclusion with about="#mwt8", but both VisualEditor and DiscussionTools remove the section nodes.

Here's a copy for reference:

I am guessing that this might be caused by the HTML comment at the beginning ofání/Rajlichova_hypotéza&action=edit:

image.png (2×3 px, 738 KB)

Event Timeline

DiscussionTools' reply widget doesn't open in the second section ("Rajlichova hypotéza") on this page:ání/seznam

Second section? I cannot open DiscussionTools in the firt section ("Hana Krampolová"). See files.

image.png (758×1 px, 201 KB)

image.png (351×1 px, 31 KB)

image.png (376×1 px, 36 KB)

Sorry, you're right, it's the same for me but I forgot as I was writing the task.

In the second section, it opens, but it will either lose your comment or insert a huge mess into the page (I haven't tried).

ssastry triaged this task as Medium priority.Aug 18 2020, 3:32 PM
ssastry added a subscriber: ssastry.

This is a bug in Parsoid. When Parsoid adds section wrappers, it tries to adjust about-ids and data-mw information appropriately so that transclusion wrappers are valid if sections are not stripped and also valid when sections are stripped (like VE does). We added this feature so VE didn't have to deal with section wrappers. But, obviously it adds extra complexity to Parsoid and in this case, looks like you stumbed on a bug. I am looking at the output with and without section wrapping, and looks like the adjustment code messed up here by changing about id of some "mwt5" spans to "mwt4" that has the transclusion typeof and data-mw info.

Since this is likely an edge case, I'm not marking this high priority.

I've tried to find a minimal test case to reproduce this, and I couldn't. I wonder if this has been fixed by some change in Parsoid in the meantime, maybe (The original test case doesn't work any more because of changes in the transcluded pages.)