Review the errors and messages in 🗎 Message keys and error messages affected by sub-references and define error messages for each case that can be implemented.
- Please see T387003: Implement basic legacy parser error handling for the `details` attribute for what's currently implemented. These are error messages as suggested by the dev team. We can tweak these any time (as long as the feature is not deployed anywhere) when needed.
- Parent (with known name) missing. The example <ref name="b" details="p1"></ref> renders as we want it. It renders as a sub-ref, but the parent cannot be found. This is reported with the old, existing message "Invalid <ref> tag; no text was provided for refs named …". We think this existing message can be confusing. There is content in the details attribute, isn't it? Should we introduce a new message for this quite common scenario? Something like "A main reference with the name "…" is used in sub-references but cannot be found on the page."?
- Parent (without name) missing. The example <ref details="p1"></ref> is hard to render in a meaningful way. We could render it as a sub-ref with a missing parent, but since that parent is empty it would trigger multiple confusing error messages. Instead we suggest to collapse this sub-ref down and render it as a stand-alone main ref with a single message. Currently that message is "<ref> tag with details must have content or point to a parent by name." Proof of concept Patch-For-Review: https://gerrit.wikimedia.org/r/1123275
- Sub-refs with conflicting main content. The example <ref name=b details=x>a</ref><ref name=b details=x>b</ref> renders the sub-refs without an error and the main ref with the existing error "Invalid <ref> tag; name "…" defined multiple times with different content". Is this good enough or do we want a more specific message that says something about sub-refs?
- Open question from https://docs.google.com/document/d/1nqcttbeBaN2QiAIlpu1Cup7IJBuaQPCANyIF_g2wDms: Under "Repeating the main content when using details" there is discussion if we should introduce a new error when the main content of a sub-reference appears multiple times. Note that merging main refs when they have the same name and content is existing behavior, and some community templates rely on it. While we cannot break this it would be possible to have stricter rules the moment the details=… attribute is used.