Page MenuHomePhabricator

Handle error cases with invalid uses of the `details` attribute in Wikitext and legacy parsing
Closed, ResolvedPublic

Description

User Story:

As an editor, editing an article in the source editor, If I make a mistake, I want to be informed about the error(s) I made.

Acceptance criteria:
  • Render Cite errors similar to how it's done right now as part of the legacy parser output

See for collecting the cases and discussions: 🗎 Message keys and error messages affected by sub-references

Out of scope:
  • VE is out of scope.
  • Parsoid is out of scope.

Event Timeline

WMDE-Fisch moved this task from Doing to Sprint Backlog on the WMDE-TechWish-Sprint-2025-02-05 board.

I updated the doc to match the cases we gathered here. Feel free to continue there or collect more cases. - Guess it makes sense to focus on the document now and come back to the ticket when we have concrete action.

Since T242227 got closed I would like to leave this here.

follow is very, very strange.

  • Combining follow and details in the same <ref> should be forbidden. It doesn't make sense to have half of a parent reference on the first page and a sub-reference on the second page.
  • Same with a follow that points to a named <ref> with details. It makes even less sense to have a sub-reference on the first page and half of the parent on the second page.

On both cases we can come back and verify these decisions in case the Wikisource community needs these combinations to behave in a specific way. But this is much easier to do this way around instead of starting with an underspecified behavior that we have to change somehow later.

Also:

  • An empty details="" should just be ignored. All other attributes behave the same. Why should we make people's lives harder and make this fail? This especially makes developing templates harder.
  • The details attribute needs to be forbidden inside of <references>. It doesn't makes sense there since there is no way to refer to such a list-defined sub-reference (there is no "subname" or something). This covers the majority of the situations listed above with just one error message.

Thanks for your feedback @thiemowmde I added cases that include details and follow to the document. I agree, that empty details is not an issue. It's just nice to document somewhere what the expected behavior is. To avoid C&P back and fourth a lot, lets focus on the document for now when we want to discuss the cases :-)

WMDE-Fisch renamed this task from Handle error cases with invalid uses of the "details" attribute in Wikitext to Handle error cases with invalid uses of the `details` attribute in Wikitext and legacy parsing.Mar 5 2025, 9:08 AM

Change #1131307 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Cite@master] More consistent, stricter error handling with empty details=""

https://gerrit.wikimedia.org/r/1131307

Change #1131307 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] More consistent, stricter error handling with empty details=""

https://gerrit.wikimedia.org/r/1131307

thiemowmde claimed this task.