Community Wishlist Survey 2022/Larger suggestions/Fix parsing inside references

Fix parsing inside references

  • Problem: Currently, inside <ref>, template substitution (subst:) and link shortcut ([[w:likethis|]]) doesn't work.
  • Proposed solution: Make the same parsing inside <ref> as outside. There should be no difference (except recursive <ref>).
  • Who would benefit: All contributors wanting to avoid hitting template inclusion limit, and avoid typing text for link.
  • More comments:
  • Phabricator tickets: T4700
  • Proposer:  ◄ David L • talk ► 23:19, 16 January 2022 (UTC)[reply]

Discussion

Hello there, we looked at the discussion inside T4700 and decided that from an engineering perspective, this would be too large for our team. We are moving it to Larger Suggestions because we still think it should get visibility. Thanks for understanding, regards NRodriguez (WMF) (talk) 01:18, 18 January 2022 (UTC)[reply]

FWIW, in the English Wikipedia we have a very powerful referencing template {{R}}, which allows to define and invoke citations and footnotes. At its core it is a wrapper around MediaWiki's Extension:Cite, therefore it is fully compatible with references using <ref> tags, and both styles can be mixed on the same page as inline references or list-defined references. It is also compatible with any other citation templates typically used inside <ref> tags to format references (including the suite of CS1/CS2 citation templates).

Due to the way it works, the pipe trick, substitution, and nesting all work when defining references through template {{R}}.

I agree that MediaWiki's parser should be improved to support these features directly, but for those who don't want to wait for this, using {{R}} might be a workaround. --Matthiaspaul (talk) 22:01, 28 January 2022 (UTC)[reply]

Using {{R}} is, however, annoying for users who edit using the visual editor, because it has very poor support for references created inside templates (see e.g. T52474). A technical solution that avoids such templates would be nice. Matma Rex (talk) 22:10, 28 January 2022 (UTC)[reply]
I would phrase that rather differently. The purpose of {{R}} is not to be a workaround to the problem stated by the OP, it exists (like other templates on top of Extension:Cite) because it provides many desirable features of a citation system in its own right - it just happens to also work around the OP's problem and therefore could be conveniently used for this purpose as well.
Yes, this still makes it desirable to have an improved MediaWiki parser so that the mentioned features work also inside of <ref> tags. One does not rule out the other.
But, no, suggesting that references in templates should be avoided (or even technically forbidden) is setting the priorities wrong. If VE does not cope well with references in templates, the problem is VE (implementation-wise or even conceptually), not references in templates. VE is a non-essential convenience extension for beginners, whereas the possibility to use references anywhere in an article (including inside of templates) belongs into the group of essential features to lay the foundation to properly referenced encyclopedic articles, the very reason of why we are here. So, if VE can't cope with it, VE (or the framework around it) should be improved, not other much more important functions put down. But not the topic of this thread... ;-)
--Matthiaspaul (talk) 15:20, 29 January 2022 (UTC)[reply]

Voting