Page MenuHomePhabricator

Include directives on a line with headings prevent the legacy parser from generating section edit links
Open, MediumPublic

Description

Check this page. If you inspect the HTML, the <h1> tag has a mw:Transclusion typeof and is embedded in a section with data-mw-section-id set to -1.

Check the [[ [[ https://ar.wiktionary.org/w/index.php?title=%D9%85%D9%8E%D8%AB%D9%92%D9%88%D9%8E%D9%89&useparsoid=0 | legacy rendering of that same page ]] and there is no edit-section link.

Also seen on mgwiktionary pages. For example, legacy vs. Parsoid and look for "Fanononana" sections.

Event Timeline

Restricted Application added subscribers: hubaishan, Aklapper. · View Herald Transcript
ssastry renamed this task from HandleParsoidSectionLinks: Edit Section links are generated for template-generated sections to HandleParsoidSectionLinks: Edit Section links are generated for some template-generated sections where legacy parser doesn't generate them.Jan 22 2025, 5:24 PM
ssastry updated the task description. (Show Details)

For the mgwiktionary one, the source of https://mg.wiktionary.org/w/index.php?title=Endrika:-fanononana-&action=edit shows

====...==== <noinclude>

which looks like what I pointed out at T368095#9912482

Similarly, https://ar.wiktionary.org/w/index.php?title=%D9%82%D8%A7%D9%84%D8%A8:%D8%B9%D8%B1%D8%A8%D9%8A%D8%A9&action=edit shows

<includeonly>=</includeonly>[[عَرَبِيَّة|فِي ٱللُّغَةِ ٱلْعَرَبِيَّةِ]]:<includeonly>=</includeonly>
[[تصنيف:عربية]]<noinclude>[[تصنيف:قوالب لغات]]</noinclude>

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

[mediawiki/services/parsoid@master] [WIP] Match legacy section numbering

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

Change #1132793 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Match legacy section numbering with sol transparent on line

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

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

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.21.0-a24

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

Change #1134218 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.21.0-a24

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

Hmm, post-deploy and purge, there's still a diff,
https://ar.wiktionary.org/w/index.php?title=%D9%85%D9%8E%D8%AB%D9%92%D9%88%D9%8E%D9%89&useparsoid=0
https://ar.wiktionary.org/w/index.php?title=%D9%85%D9%8E%D8%AB%D9%92%D9%88%D9%8E%D9%89&useparsoid=1

The patch in T384490#10697038 only handles the top-level case. For templated sections, the include directives will have been processed so Parsoid won't know if they occurred on a line with the headings. Somewhat analogous to T387520. Maybe I should have gone the other direction and made the legacy parser not get tripped by these include directives on the line.

T214538 seems like another way forward.

ABreault-WMF renamed this task from HandleParsoidSectionLinks: Edit Section links are generated for some template-generated sections where legacy parser doesn't generate them to Include directives on a line with headings prevent the legacy parser from generating section edit links.Apr 10 2025, 8:08 PM