Page MenuHomePhabricator

Nested reference handling in both parsers
Open, Needs TriagePublic

Description

Context

Currently there are two ways to "nest" references in an article.

#1.: {{#tag:ref|outside ref #1 <ref>inside ref #1</ref>}}

#2.: <ref>outside ref #2 {{#tag:ref|inside ref #2}}</ref>

While the former is well supported in both parsers. The latter is not so much. In any of them.

Legacy:

image.png (270×480 px, 8 KB)

Parsoid:

image.png (270×480 px, 8 KB)

Task
  • Can and do we want to support both ways equally? Are there reasons not to?
  • Would it be sufficient to add better support for latter case only to Parsoid?
Notes

T124213: Nested references rendered in wrong order in reflist while ungrouped could be related

Event Timeline

While the former is well supported in both parsers. The latter is not so much. In any of them.

The Parsoid implementation is actively suppressing support for the latter to match the legacy output,
https://github.com/wikimedia/mediawiki-extensions-Cite/blob/master/src/Parsoid/RefTagHandler.php#L34-L38

MSantos subscribed.

We should wait until Read Views is done to avoid working on the legacy parser codepath.