Page MenuHomePhabricator

Parsoid needs a native implementation of <poem>
Closed, ResolvedPublic

Description

If a citation is used in the <poem> extension, Parsoid cannot integrate it with the global cite state of the page since it is expanded by the mediawiki parse API. This is an instance of T110909: Parsoid tripped up by extensions that process wikitext

Original bug description

https://en.wikipedia.org/api/rest_v1/page/html/William_Shakespeare/821432052 shows a portion of a reference list in the wrong location. It looks like it creates a new reference list right after where the reference is made.

Wikitext:

''And cvrst be he [[File:Middle English that.svg|Middle English that.svg]] moves my bones.''{{sfn|Schoenbaum|1987|p=306}}{{efn|In the scribal abbreviations ''ye'' for ''the'' (3rd line) and ''yt'' for ''that'' (3rd and 4th lines) the letter ''y'' represents ''th'': see ''[[thorn (letter)|thorn]]''.}}

Parsoid:
The text ends with references [1][a], followed by a portion of the notelist which should appear in the Notes section, plus the Cite error message: Cite error: There are <ref group=lower-alpha> tags or {{efn}} templates on this page, but the references will not show without a {{reflist|group=lower-alpha}} template or {{notelist}} template (see the help page).
I'm aware that the Cite error message can happen but that doesn't explain why the ref counter starts over and a erroneous reflist just above the Cite error appears.

Screen Shot 2018-02-27 at 9.36.05 PM.png (215×565 px, 46 KB)

There is an {{efn}} template used, which happens to come right after a {{sfn}} usage, and in the Notes section the corresponding {{notelist}} template is used as well. So, the error message doesn't seem helpful in resolving this.

This is how it looks on Desktop.

Screen Shot 2018-02-27 at 9.34.57 PM.png (119×565 px, 28 KB)

In the Notes section Desktop shows the reference details for this: "In the scribal abbreviations ye for the (3rd line) and yt for that (3rd and 4th lines) the letter y represents th: see thorn.", whereas in Parsoid output this part is not shown. It seems to me that instead of that text the erroneous {{notelist}} portion "Schoenbaum 1987, p. 306." is shown in the middle of the page.

Not sure if this a Parsoid or a Cite issue.

Event Timeline

This is because of Parsoid not having a native implementation of the poem template -- another instance of T110909: Parsoid tripped up by extensions that process wikitext. So, this will be solved either when Parsoid is merged back into core or when we port the poem extension to node.js .. given the timeline, we have to do the latter for now ... ugh .. more code duplication.

ssastry triaged this task as Medium priority.Mar 15 2018, 11:31 PM
ssastry removed a project: Cite.
ssastry renamed this task from Cite error messes up reference lists in Parsoid output to Parsoid needs a native implementation of <poem>.Mar 15 2018, 11:35 PM
ssastry updated the task description. (Show Details)
ssastry moved this task from Needs Triage to Read Views on the Parsoid board.

Change 420118 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/services/parsoid@master] WIP: Native Parsoid impl of Poem

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

Change 420118 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Updated extension interface + native Parsoid impl of Poem

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

Arlolra claimed this task.
Arlolra reassigned this task from Arlolra to ssastry.
Arlolra subscribed.