Page MenuHomePhabricator

Section wrapping should use precise information about HTML-syntax headings
Open, LowPublic

Description

Parsoid doesn't add section edit links around HTML-syntax headings, and shortly (T417530) won't add <section> wrappers around HTML-syntax heading either.

For compatibility with the legacy parser we currently use the same heuristic which the legacy parser does: the presence of "extra" attributes on the <hX> tag. However Parsoid has precise information about the tag syntax in the data-parsoid, and the legacy parser could be extended to encode precise information as well, eg by adding a placeholder data-mw-wikitext-syntax attribute to headings generated from == ... == syntax.

This should be done after T417530: Parsoid shouldn't wrap wikitext html-ish `<hX>` tags in <section> wrappers if we find that there are significant numbers of "no attribute" html-syntax headings that are generating problematic <section> wrappers.

Event Timeline

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

[mediawiki/extensions/DiscussionTools@master] [WIP] Update definition of html heading to match Parsoid/core

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

Change #1302237 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Update definition of html heading to match Parsoid/core

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

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

[mediawiki/extensions/DiscussionTools@wmf/1.47.0-wmf.7] Update definition of html heading to match Parsoid/core

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

Change #1302934 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@wmf/1.47.0-wmf.7] Update definition of html heading to match Parsoid/core

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

Mentioned in SAL (#wikimedia-operations) [2026-06-16T21:15:28Z] <cscott@deploy1003> Started scap sync-world: Backport for [[gerrit:1302934|Update definition of html heading to match Parsoid/core (T417530 T417531 T428677)]]

Mentioned in SAL (#wikimedia-operations) [2026-06-16T21:17:23Z] <cscott@deploy1003> arlolra, cscott: Backport for [[gerrit:1302934|Update definition of html heading to match Parsoid/core (T417530 T417531 T428677)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-06-16T21:34:10Z] <cscott@deploy1003> Finished scap sync-world: Backport for [[gerrit:1302934|Update definition of html heading to match Parsoid/core (T417530 T417531 T428677)]] (duration: 18m 41s)

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

[mediawiki/services/parsoid@master] Add `data-mw-wikitext` to wikitext-syntax headings

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

Moving back to code review, as https://gerrit.wikimedia.org/r/1302971 is still unmerged. (And even after it is merged, we might want to do some clean up before fully closing this task.)

Change #1302971 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Add `data-mw-wikitext` to wikitext-syntax headings

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

Change #1351383 had a related patch set uploaded (by OSleger; author: OSleger):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.24.0-a26

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

Change #1351383 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.24.0-a26

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