Page MenuHomePhabricator

Parsoid emits parsoid fragment markers on some template namespace pages
Closed, ResolvedPublic

Description

See Parsoid output vs legacy output. This looks like a bug in Parsoid's fragment support likely.

Also seen on this awawiki template page.

Event Timeline

ssastry renamed this task from Parsoid doesn't process Template:Hlist correctly on cbk_zamwiki to Parsoid emits parsoid fragmnet markers on some template namespace pages.Jul 15 2025, 5:48 PM
ssastry updated the task description. (Show Details)
ssastry renamed this task from Parsoid emits parsoid fragmnet markers on some template namespace pages to Parsoid emits parsoid fragment markers on some template namespace pages.Jul 15 2025, 8:50 PM
ssastry raised the priority of this task from Medium to High.Sep 8 2025, 8:08 PM

This is showing up on lots of wikis and we should fix this sooner than later.

I believe this is caused by the <pre> extension, which is not fragment-aware. We already use the PFragment machinery to dispatch legacy extension tags. My plan to address this is to attempt to use the PFragment machinery to dispatch Parsoid-native extensions as well. (I expect this bug to affect all Parsoid-native extensions t the moment.) Template:Pre is a bit of an unusual case, though, so some special case case in the pre handler may still be necessary, we'll see.

Change #1202885 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/services/parsoid@master] Add tests for template pre hack

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

Change #1202885 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Add tests for template pre hack

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

Change #1203504 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.23.0-a3

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

Change #1203504 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.23.0-a3

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

Change #1217714 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/services/parsoid@master] Add a regression test for leaking fragment marker

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

Change #1217714 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Add a regression test for leaking fragment marker

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

Change #1225504 had a related patch set uploaded (by Isabelle Hurbain-Palatin; author: Isabelle Hurbain-Palatin):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.23.0-a11

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

Change #1225504 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.23.0-a11

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

A number of these cases were from the template pre hack, which is covered in T353697

@ssastry had mentioned an unresolved case from rt testing, which I've filed as T415591 and isn't the same as fragment markers showing up in the read view, they are showing up in roundtrip information being saved from template expansion source

From the task map,

T398969	Fragment marker in output	fatwiki, tumwiki, awawiki, cbk_zamwiki, cdowiki, avwiki, diqwiki, dzwiki, shnwiki, mnwwiki ... many ...

tumwiki and plwiki cases were fixed by https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/1217714

tumwiki cases from this sheet are no longer present

fatwiki cases from this sheet are no longer present

awawiki and cbk_zamwiki case from this sheet are no longer present

cdowiki cases from this sheet are no longer present

avwiki cases from this sheet are no longer present

I think we close this out and re-open or file a more specific task if we encounter any more cases in the wikis yet to be deployed to