When we aligned on the error message for the different details error case we need to implement these into the legacy and Parsoid parser code.
We might want to wait with that until the cleanup of that validation is done though. See T387002: Try to reduce duplicate code in reference validation
Error messages and case:
The document https://docs.google.com/document/d/1nqcttbeBaN2QiAIlpu1Cup7IJBuaQPCANyIF_g2wDms lists all possible error cases. The parent ticket T386212 discusses a few. So far we agreed on:
- No main content due to missing or wrong name or empty content
- Proposed error message:
- "<ref> tag with details must have content or point to a parent by name." or
- "<ref> tag with a details attribute must have main content or point to a main reference by name."
- When a name is given but the parent not found the existing message "Invalid <ref> tag; no text was provided for refs named …" is correct, in our opinion.
- Open question for WMDE-Design: Do you think we need a new message for the old scenario above? Or should the new message be shown instead?
- Patch-For-Review: https://gerrit.wikimedia.org/r/1122130
- Proposed error message:
- There is no scenario in wich it makes sense to use details in the <references> block.
- Proposed error message:
- "<ref> tag with name "…" cannot use details when inside <references>." or
- "<ref> tag with name "…" cannot use the details attribute when inside <references>." or
- "References with details cannot be used inside of a <references> tag."
- Open question for WMDE-Design: Including the name can be beneficial to track down the source of the error, but might not be needed for such a general message.
- Patch-For-Review: https://gerrit.wikimedia.org/r/1121617
- Proposed error message:
- Combining follow and details doesn't make sense.
- Proposed error message: "A <ref follow="…"> tag that is the continuation of a previous one cannot be named individually or have details." This intentionally combines two scenarios that are invalid for the same reason to not have to many almost identical error messages.
- Open question for WMDE-Design: Should it mention the value in follow="…" to make it easier to find the source of the error? We don't think this is needed because it is almost guaranteed that there is only ever a single follow on a page.
- Patch-For-Review: https://gerrit.wikimedia.org/r/1121620

