Page MenuHomePhabricator

Parsoid processes transclusions incorrectly when they come from a template
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Go to https://is.wikipedia.org/wiki/Flokkur:List and note the existance of the "úrdráttur" template.
  • Go to the template page and see that the template transcludes articles
  • Go back to Flokkur:List, edit it and add "{{:List}}" to the page and preview it.

What happens?:

  • Note that the direct transclusion works (the latter one), but not through the template

Same thing happens in the old parser.

What should have happened instead?:
Both the direct transclusion and the one through the template should work. There would be one transclusion in step 1 and two in step 4.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.): Firefox 140.0.2 on Win10

Event Timeline

The <onlyinclude> is within <noinclude> and <nowiki> in the template, but when transcluded the <noinclude> and <nowiki> are ignored and only the part within <onlyinclude> is transcluded. I don't know what should happen when that combination of tags is used. As it's only in the notes and not intended to function as a tag in that template, the < can be changed to &lt; for the onlyinclude tags

Tested Peter´s claim and he is correct. Removing the onlyinclude and nowiki in the template does make the transclusion of the article appear. Removing only the nowiki fails the article transclusion.
The way I see it parsoid is ignoring two layers of protection of using the noinclude tag, the first one being the noinclude tag, and the second being the nowiki tag.
Nowiki and noinclude are commonly used in documentation. Nowiki should show the tags within literally, as "<noinclude>", without activating their functions.

Found this bug originally because two categories where in their own category and that category link came from a transclusion of the article, which I then fixed. This is a regression.

<onlyinclude> is documented on https://www.mediawiki.org/wiki/Transclusion as,

This is the most subtle of the partial transclusion tags because it often overrules the others. If there is at least one pair of "onlyinclude" tags on a page, then whenever this page is transcluded, it is only the material within the "onlyinclude" tags that is transcluded.

It has a higher precedence than noinclude or nowiki and appears to be working as intended.

Both Parsoid and the legacy parser use the same preprocessor so it's expected that they'd handle these include directives in the same way.

Expanding on my previous point. I discovered this on category "Flokkur:Jörðin", which had a categorylink to itself, because article "Jörðin" is in that category and was being transcluded by template "Snið:Úrdráttur". Compare the last iswiki dump to current categorylinks. 1694 is the page id of the article. I belive the second categorylink is due to an active transclusion, indicating that the transclusion did work previously.

Dump 2025-06-20:
(1694,'Jörðin','<]oL1:D<]oL1:D܀܉','2025-06-24 16:44:57','Jörðin','uca-is','page',1,64402)
(1694,'Jörðin','<]oL1:D<]oL1:D܀܉','2025-06-24 16:44:57','Jörðin','uca-is','page',1,64402)

Current (queried with superset):
1694 Jörðin [bytes] 2025-06-24T16:44:57 Jörðin uca-is page 1 64402

Dump 2025-06-20:
(1694,'Jörðin','<]oL1:D<]oL1:D܀܉','2025-06-24 16:44:57','Jörðin','uca-is','page',1,64402)
(1694,'Jörðin','<]oL1:D<]oL1:D܀܉','2025-06-24 16:44:57','Jörðin','uca-is','page',1,64402)

The dates listed there are 24-06-2025 but that's supposed to be a dump of 2025-06-20.

Also, I don't see a categorylink to itself (which would be a subcategory) on 20250615
https://web.archive.org/web/20250615221026/https://is.wikipedia.org/wiki/Flokkur:J%C3%B6r%C3%B0in