Page MenuHomePhabricator

Parsoid: p-wrapping shouldn't try to wrap <aside> tags
Closed, ResolvedPublic

Description

The PortableInfobox extension uses an aside element to wrap its infobox content. It seems that <aside> tags don't play well with p-wrapping in Parsoid, so an article containing such an extension tag will end up with empty p-wrappers around the tag.

Per discussion with @ssastry , we should probably make Parsoid aware of <aside> semantics like it was done for <figure> previously, to avoid this behavior.

Event Timeline

Change 675177 had a related patch set uploaded (by TK-999; author: TK-999):
[mediawiki/services/parsoid@master] Don't p-wrap <aside> tags in extension HTML

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

What's happening is that the doBlockLevels in the legacy parser tries to paragraph wrap the aside, because it isn't aware of the content model violation. When treebuilding happens, the paragraph gets split leading to the empty paragraphs.

The problem isn't Parsoid per se, it's Parsoid copying the legacy parser bug for bug. If you inspect the extension content coming from the legacy parser in a read view, you'll see the empty paragraphs that are suppressed with css.

The proposed fix is fine but we should do it in the legacy parser first.

Arlolra triaged this task as Medium priority.Mar 31 2021, 4:26 PM
Arlolra moved this task from Needs Triage to Missing Functionality on the Parsoid board.

Change 676108 had a related patch set uploaded (by TK-999; author: TK-999):

[mediawiki/core@master] Don't p-wrap <aside> tags in extension HTML

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

Change 676108 merged by jenkins-bot:

[mediawiki/core@master] Don't p-wrap <aside> tags in extension HTML

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

Change 682741 had a related patch set uploaded (by Arlolra; author: TK-999):

[mediawiki/services/parsoid@main] Don't p-wrap <aside> tags in extension HTML

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

Change 675177 abandoned by Arlolra:

[mediawiki/services/parsoid@master] Don't p-wrap <aside> tags in extension HTML

Reason:

I've retargeted this against main instead of master in https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/ /682741

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

Change 682741 merged by jenkins-bot:

[mediawiki/services/parsoid@main] Don't p-wrap <aside> tags in extension HTML

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

Arlolra assigned this task to TK-999.

Change 684500 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.14.0-a2

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

Change 684500 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.14.0-a2

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