A number of legacy Parser behavior amount to embedding something like the following in the output wikitext:
<span class="error" style="font-color:red; font-weight: bold">Error of some kind</span>
This adheres to the social conventions on our wiki, in terms of making errors highly visible to readers in order to motivate them to become editors and fix the mistake.
Previously, we'd used typeof="mw:Error" in our Parsoid output and relied on Visual Editor to use this machine-readable information to provide appropriate UX for editors. But as we move towards Parsoid read views, we need to duplicate the reader experience as well.
We already have T266666: Localization html2html pass for Parsoid to cover the localization part, and typeof="mw:Error" provides coarse-grained positioning, identifying the specific extension or transclusion at fault.
But in many cases the legacy parser provides more specific positioning: a gallery might indicate an error *at the specific location in the gallery where it occurs*, a citation might indicate an error *at a specific location in the references list*, math markup might indicate an error *at a specific operator or LaTeX command*. We should develop a spec which allows the mw:Error to be specifically positioned in the result HTML, with a localized message *in read views* that matches as far as possible the existing experience with the legacy parser.
I suggest that we use the following three cases are pathfinders, and draft what we'd expect/like to see the output HTML look like for various errors in:
- The Cite extension
- The Gallery extension
- The {{int}} parser function -- both normal output and exception output are interesting in this case, as they would both use the localization html2html pass of T266666 but perhaps in slightly different ways. See https://www.mediawiki.org/wiki/Help:Magic_words#int