To handle a variety of Cite errors, we propose the following:
All citations will use sup format and include mw:Error meta data annotation
All error messages will show up in the references section
Note that this is in contrast to core where if the error happens while processing refs, it's inlined.
If the error happens when building the references list, the error is inserted there.
That's a by-product of the implementation, and not necessarily a goal.
There are benefits to having the errors inline, like where the problem occurs is obvious and more likely to be fixed,
and broken citations don't give a sentence more weight in the reader's eyes, but we feel these can just as easily
be accomplished by css styling based on the mw:Error annotation.
Continuing to output sup means that current clients will likely not need any changes other
then doing what they want with the mw:Error and so no major version bump would be necessary.
Also I don't expect to need to use "mw:Placeholder" as VE and other clients should be able to just ignore a citation without actual content and Selser will round trip the error correctly, and not cause the error text to become the content, while still allowing an editor to edit the content at a point of citation which will then replace the error message.
In reviewing Subbu's alternative results for ref and reference, I've included some new elements, but preserved the structure of the non error format more closely such as keeping the href inside the <span class="mw-linkback-text ... block.
Implementation details:
requires a second pass if an error has been found that requires mw:Error to be inserted at the point of citation which could not be determined during the first pass.
i.e. named refs with no content and no other similarly named ref found on a page.
We can collect pointers to would be errors on the first pass and release them when they're proven not to be errors. Then at the end you'll have a collection to annotate.
An example of correct citation inline and references html output for comparison to proposed incorrect citation missing content/text in result output below
```
zero<ref name="one">two</ref>
<references />
<p>zero<sup about="#mwt3" class="mw-ref" id="cite_ref-one_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","attrs":{"name":"one"},"body":{"id":"mw-reference-text-cite_note-one-1"}}'><a href="./index.php%3Ftitle=CiteTest#cite_note-one-1" style="counter-reset: mw-Ref 1;"><span class="mw-reflink-text">[1]</span></a></sup></p>
<div class="mw-references-wrap" typeof="mw:Extension/references" about="#mwt6" data-mw='{"name":"references","attrs":{}}'><ol class="mw-references references" data-parsoid="{}"><li about="#cite_note-one-1" id="cite_note-one-1" data-parsoid="{}"><a href="./index.php%3Ftitle=CiteTest#cite_ref-one_1-0" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-one-1" class="mw-reference-text">two</span></li></ol></div>
```
Incorrect citation inline (no content/text) produces an editable citation inline, but no inline error message, which is located in the references text. In this case the i18n error message key "cite_error_references_no_text" is included in the data-mw errors section and the english string is installed in the reference itself by using a snapshot of cores Cite/i18n/en.json strings indexed by the appropriate error message key.
```
<p>zero<sup about="#mwt3" class="mw-ref" id="cite_ref-one_1-0" typeof="mw:Error mw:Extension/ref" data-mw='{"errors": ["cite_error_references_no_text"], "name":"ref","attrs":{"name":"one"},"body":{"id":"mw-reference-text-cite_note-one-1"}}'> id="cite_ref-one_1-0" class="reference"><a href="./index.php%3Ftitle=CiteTest#cite_note-one-1"><span class="mw-reflink-text">[1]</span></a></sup></p>
<div class="mw-references-wrap" typeof="mw:Extension/references"><ol class="references"><li about="#cite_note-one-1" id="cite_note-one-1"><span class="mw-cite-backlink"><a href="./index.php%3Ftitle=CiteTest#cite_ref-one_1-0">↑</a></span> <span class="error mw-ext-cite-error" lang="en" dir="ltr">Cite error: Invalid <code><ref></code> tag; no text was provided for refs named <code>one</code></span></li></ol></div>
```