Page MenuHomePhabricator

ProofreadPage transclusion with useparsoid=1 misplaces <references />
Closed, ResolvedPublicBUG REPORT

Description

On s:Relativity (1931) with useparsoid=1, the one footnote transcluded is shown in the middle of the text (at the end of the transcluded unit) rather than at the end of the page where the {{smallrefs}} template (styled <references />) is.

As a guess at what may be happening, it looks kinda like Parsoid is implementing Cite.php internally and assuming the end of a unit of output is the end of the page, and since a <references /> tag has not been seen it forcibly outputs one. Loading the page without useparsoid=1 shows the footnote at the end of the page as expected.

I can't immediately see that we're doing anything magical on-wiki that should affect this. The transcluded footnote is defined with <ref>...</ref> and the {{smallrefs}} template is just a thin wrapper around <references /> ala. {{notelist}} and friends on enWP. The only unique-ish thing is that [[Relativity (1931)]] consists of a Proofread Page-mediated transclusion of multiple other entire wikipages from the Page: namespace (rather than from the Template: namespace, which is somewhat special-cased, I suspect). The PRP-transclusion is also done in multiple units—and the misplaced footnote appears at the end of one such unit—so this may be caused by something like how PRP calls Parsoid, or what context is passed, or the order of calls, or similar.

Event Timeline

Per @Arlolra in T274654#6946964 this is actually almost precisely the opposite of what I assumed in the task description: Parsoid isn't parsing the content of extension tags and instead calls out to the legacy parser. Since the legacy parser can't see outside its context (the extension tag content) neither does the nested call to Cite, which therefore has no way to know there is a <references /> tag elsewhere and thus emits one at the end of the extension tag content (the individual PRP <pages … /> tag). The patch that just landed for T278481 is likely to wholly or partially fix this issue.

After https://phabricator.wikimedia.org/T278481 it looks like footnotes between legacy and parsoid are rendered with any visual differences

Jgiannelos claimed this task.