Page MenuHomePhabricator

Parsoid section edit link issues
Closed, ResolvedPublic

Description

This is a tracking task for incorrect edit section links rendered by Parsoid.

The root cause is that Parsoid uses the legacy preprocessor to expand templates, and since the legacy parser assigns heading ids in that pass, Parsoid loses information related to those id assignments. While we considered a number of different strategies to address this, for simplicity, we eventually landed on having the preprocessor bundle information and pass it back to Parsoid to ensure Parsoid assigns section ids in a manner compatible with the legacy parser.

The child tasks capture the various scenarios where this manifests, plus other edge cases related to bad markup.

Previous solution strategy (not pursued)

Previously, this task linked to a google doc that is not externally accessible, so recording a brief summary here:

  • Make edit section save functionality be Parsoid-aware: If we make the edit section API be Parsoid-aware, we ensure that we don’t behave in an unexpected manner when using it even if the id assignment is different from what the core parser would have assigned. We didn't pursue this because it means that bookmarked links will be broken plus in the transition phase, gadgets and clients relying on section ids might need to deal with different section editing APIs.
  • Don’t assign heading ids in the tokenizer: This is T214538. This required too many changes to the legacy parser and unsure what else we might break
  • Reduce id-assignment discrepancies between legacy and Parsoid: This is a good thing but won't address the root cause.

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

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

[mediawiki/services/parsoid@master] [WIP] Add HeadingPFragment type

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

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

[mediawiki/core@master] [WIP] Return HeadingPFragments

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

Change #1304193 merged by jenkins-bot:

[mediawiki/core@master] [parser] Return HeadingPFragments while preprocessing

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

Change #1304192 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Add a HeadingPFragment type to be returned by the preprocessor

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

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

[mediawiki/core@wmf/1.47.0-wmf.8] [parser] Return HeadingPFragments while preprocessing

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

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

[mediawiki/core@wmf/1.47.0-wmf.7] [parser] Return HeadingPFragments while preprocessing

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

Change #1305015 merged by jenkins-bot:

[mediawiki/core@wmf/1.47.0-wmf.8] [parser] Return HeadingPFragments while preprocessing

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

Mentioned in SAL (#wikimedia-operations) [2026-06-23T13:29:20Z] <cscott@deploy1003> Started scap sync-world: Backport for [[gerrit:1305015|[parser] Return HeadingPFragments while preprocessing (T391624 T387520 T387521 T384490 T387374)]], [[gerrit:1305026|[parser] Return ExtTagPFragments while preprocessing (T429624)]]

Mentioned in SAL (#wikimedia-operations) [2026-06-23T13:31:31Z] <cscott@deploy1003> cscott: Backport for [[gerrit:1305015|[parser] Return HeadingPFragments while preprocessing (T391624 T387520 T387521 T384490 T387374)]], [[gerrit:1305026|[parser] Return ExtTagPFragments while preprocessing (T429624)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-06-23T13:41:53Z] <cscott@deploy1003> Finished scap sync-world: Backport for [[gerrit:1305015|[parser] Return HeadingPFragments while preprocessing (T391624 T387520 T387521 T384490 T387374)]], [[gerrit:1305026|[parser] Return ExtTagPFragments while preprocessing (T429624)]] (duration: 12m 31s)

Change #1305018 merged by jenkins-bot:

[mediawiki/core@wmf/1.47.0-wmf.7] [parser] Return HeadingPFragments while preprocessing

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

Mentioned in SAL (#wikimedia-operations) [2026-06-23T13:44:02Z] <cscott@deploy1003> Started scap sync-world: Backport for [[gerrit:1305017|[parser] Add configuration to return experimental PFragment types]], [[gerrit:rGOJU130501848b37|[parser] Return HeadingPFragments while preprocessing (T391624 T387520 T387521 T384490 T387374)]], [[gerrit:1305025|[parser] Return ExtTagPFragments while preprocessing (T429624)]]

Mentioned in SAL (#wikimedia-operations) [2026-06-23T13:46:11Z] <cscott@deploy1003> cscott: Backport for [[gerrit:1305017|[parser] Add configuration to return experimental PFragment types]], [[gerrit:rGOJU130501848b37|[parser] Return HeadingPFragments while preprocessing (T391624 T387520 T387521 T384490 T387374)]], [[gerrit:1305025|[parser] Return ExtTagPFragments while preprocessing (T429624)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be v

Mentioned in SAL (#wikimedia-operations) [2026-06-23T13:52:30Z] <cscott@deploy1003> Finished scap sync-world: Backport for [[gerrit:1305017|[parser] Add configuration to return experimental PFragment types]], [[gerrit:rGOJU130501848b37|[parser] Return HeadingPFragments while preprocessing (T391624 T387520 T387521 T384490 T387374)]], [[gerrit:1305025|[parser] Return ExtTagPFragments while preprocessing (T429624)]] (duration: 08m 29s)

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

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

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

Change #1305690 merged by jenkins-bot:

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

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

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

[operations/mediawiki-config@master] Turn on Parsoid's 'ReturnExperimentalPFragmentTypes'

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

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

[mediawiki/core@master] Always use HeadingPFragment and ExtTagPFragment

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

Change #1305712 abandoned by C. Scott Ananian:

[mediawiki/core@master] Always use HeadingPFragment and ExtTagPFragment

Reason:

would require changes to cite parser tests which make this unfeasible as a backport

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

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

[mediawiki/vendor@wmf/1.47.0-wmf.8] Bump wikimedia/parsoid to 0.24.0-a12

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

Change #1305719 merged by jenkins-bot:

[mediawiki/vendor@wmf/1.47.0-wmf.8] Bump wikimedia/parsoid to 0.24.0-a12

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

Mentioned in SAL (#wikimedia-operations) [2026-06-25T16:36:37Z] <cscott@deploy1003> Started scap sync-world: Backport for [[gerrit:1305719|Bump wikimedia/parsoid to 0.24.0-a12 (T353697 T384490 T387374 T387520 T387521 T391624 T393295 T420336 T429624 T429688 T429822)]], [[gerrit:1305720|Bump wikimedia/parsoid to 0.24.0-a12 (T429822)]]

Mentioned in SAL (#wikimedia-operations) [2026-06-25T16:46:32Z] <cscott@deploy1003> Finished scap sync-world: Backport for [[gerrit:1305719|Bump wikimedia/parsoid to 0.24.0-a12 (T353697 T384490 T387374 T387520 T387521 T391624 T393295 T420336 T429624 T429688 T429822)]], [[gerrit:1305720|Bump wikimedia/parsoid to 0.24.0-a12 (T429822)]] (duration: 09m 54s)

Change #1305711 merged by jenkins-bot:

[operations/mediawiki-config@master] Turn on Parsoid's 'ReturnExperimentalPFragmentTypes'

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

Mentioned in SAL (#wikimedia-operations) [2026-06-25T16:50:46Z] <cscott@deploy1003> Started scap sync-world: Backport for [[gerrit:1305711|Turn on Parsoid's 'ReturnExperimentalPFragmentTypes' (T429624 T429822 T391624)]]

Mentioned in SAL (#wikimedia-operations) [2026-06-25T16:52:51Z] <cscott@deploy1003> cscott: Backport for [[gerrit:1305711|Turn on Parsoid's 'ReturnExperimentalPFragmentTypes' (T429624 T429822 T391624)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-06-25T17:42:46Z] <cscott@deploy1003> Finished scap sync-world: Backport for [[gerrit:1305711|Turn on Parsoid's 'ReturnExperimentalPFragmentTypes' (T429624 T429822 T391624)]] (duration: 51m 59s)

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

[operations/mediawiki-config@master] Turn on Parsoid's 'ReturnExperimentalPFragmentTypes' (take 2)

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

Change #1305740 abandoned by C. Scott Ananian:

[operations/mediawiki-config@master] Turn on Parsoid's 'ReturnExperimentalPFragmentTypes' (take 2)

Reason:

Let's try something simpler: I8d9bec0c46775b3aaadc002f97858af943124bea

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

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

[operations/mediawiki-config@master] Turn on Parsoid's 'ReturnExperimentalPFragmentTypes'

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

Change #1305733 merged by jenkins-bot:

[operations/mediawiki-config@master] Turn on Parsoid's 'ReturnExperimentalPFragmentTypes'

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

Mentioned in SAL (#wikimedia-operations) [2026-06-25T19:05:36Z] <cscott@deploy1003> Started scap sync-world: Backport for [[gerrit:1305733|Turn on Parsoid's 'ReturnExperimentalPFragmentTypes' (T429624 T429822 T391624)]]

Mentioned in SAL (#wikimedia-operations) [2026-06-25T19:07:28Z] <cscott@deploy1003> cscott, arlolra: Backport for [[gerrit:1305733|Turn on Parsoid's 'ReturnExperimentalPFragmentTypes' (T429624 T429822 T391624)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-06-25T19:27:43Z] <cscott@deploy1003> Finished scap sync-world: Backport for [[gerrit:1305733|Turn on Parsoid's 'ReturnExperimentalPFragmentTypes' (T429624 T429822 T391624)]] (duration: 22m 07s)

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

[operations/mediawiki-config@master] Turn on Parsoid's 'ReturnExperimentalPFragmentTypes' (take 2)

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

Change #1305746 merged by jenkins-bot:

[operations/mediawiki-config@master] Turn on Parsoid's 'ReturnExperimentalPFragmentTypes' (take 2)

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

Mentioned in SAL (#wikimedia-operations) [2026-06-25T19:52:01Z] <cscott@deploy1003> Started scap sync-world: Backport for [[gerrit:1305746|Turn on Parsoid's 'ReturnExperimentalPFragmentTypes' (take 2) (T429624 T429822 T391624)]]

Mentioned in SAL (#wikimedia-operations) [2026-06-25T19:53:30Z] <cscott@deploy1003> cscott: Backport for [[gerrit:1305746|Turn on Parsoid's 'ReturnExperimentalPFragmentTypes' (take 2) (T429624 T429822 T391624)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-06-25T19:58:59Z] <cscott@deploy1003> Finished scap sync-world: Backport for [[gerrit:1305746|Turn on Parsoid's 'ReturnExperimentalPFragmentTypes' (take 2) (T429624 T429822 T391624)]] (duration: 06m 58s)

ABreault-WMF claimed this task.