Page MenuHomePhabricator

Clean up a rare edge case in section-wrapping and extension-content interaction
Closed, ResolvedPublic

Description

Consider this wikitext snippet below:

==h1==
foo
<translate>
bar
==h2==
baz
</translate>
booz

As part of section wrapping, the DOM is restructured .. for example what used to be a linear list of children of body will get split up into different top-level section nodes. On occasion, if content from adjacent sections come from the same extension, we need to reconcile this conflict between the section boundary and the extension boundary such that the extension wrapper isn't broken up.

When this happens, we might hoist the data-mw and extension wrapper information to a section tag. But since there might be child nodes before / after the extension content that is also part of the section, the extension wrapper on the section tags has to represent this additional content that gets pulled into the new extension-content boundary.

To capture this, we are introducing an extPrefix and extSuffix property to the data-mw object added to the extension wrapper. In turn, this means that serialization has to be aware of this.

Right now, we are not exposing this ugliness in the HTML spec. This phab task is to figure out if there is a way we can avoid this messiness somehow.

Event Timeline

ssastry lowered the priority of this task from High to Medium.Apr 22 2019, 2:06 PM
ssastry edited projects, added Parsoid-Read-Views-Deprecated-Project; removed Parsoid.

Can we just lint this out? I think this isn't best practice for translations anyway. I'd rather say "don't do that".

Failing that, what would be consistent with how we handle templates? Because this same issue happens for template-generated sections (although again, I'm tempted to say "don't do that"...).

Change 637887 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/services/parsoid@master] Redo template-section boundary conflict code

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

Change 637887 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Redo template-section boundary conflict code

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

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

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

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

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

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

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

Change 646771 merged by jenkins-bot:
[mediawiki/vendor@wmf/1.36.0-wmf.21] Bump wikimedia/parsoid to 0.13.0-a19

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

ssastry claimed this task.