Page MenuHomePhabricator

Special:ExpandTemplates cannot display nested references with #tag:ref
Open, Needs TriagePublic

Description

This code works in a wiki page, e.g. https://en.wikipedia.org/wiki/Wikipedia:Sandbox:

Statement.{{#tag:ref|Note for statement.<ref>Reference for note.</ref>|group=note}}
== Notes ==
<references group="note" />
== References ==
<references />

https://en.wikipedia.org/wiki/Special:ExpandTemplates says the result is:

Statement.<ref group="note">Note for statement.<ref>Reference for note.</ref></ref>
== Notes ==
<references group="note" />
== References ==
<references />

The preview on Special:ExpandTemplates then fails with:
"A <ref> tag is missing the closing </ref> (see the help page)"

The message is https://en.wikipedia.org/wiki/MediaWiki:Cite_error_included_ref (customized at enwiki).
If the result from ExpandTemplates with <ref... instead of {{#tag:ref... is copied to a wiki page then it pruduces the same error message. The problem is apparently that Expandtemplates tries to display a version where #tag:ref has been converted to <ref>. I guess this could also affect other uses of #tag. If it's difficult to change then maybe it should just be mentioned clearly in https://www.mediawiki.org/wiki/Help:ExpandTemplates. It currently says:

"In addition there is a preview area. However, this shows the rendered result of expanding the expanded wikitext again (T30616). Although the result is usually the same as after single expansion, it can be different if the first expansion produces braces."