Specs/HTML/2.7.0/Extensions/Cite

NOTE: In the rest of this spec below, when we say Cite implementation, we are referring to the implementation that targets Parsoid. Currently this code lives in the Parsoid repository but will be moved to the Cite repository at some point.

Preliminaries
An example with transcluded reference content,

renders as follows. (Note the references section was autogenerated)

Ref and References
First one Second one Named one Reused Reused again

property rather than copying the HTML dom in the  property. But, both formats are considered valid and Cite accepts both formats when serializing HTML to wikitext.

If  is specified, it is the client's responsibility to make sure that the element id is present in the DOM. If both  and   are specified, Cite uses the html property and ignores the id property.

Auto-generated references blocks
If the source wikitext had &lt;ref> tags but no corresponding &lt;references> tag to generate references, Cite auto-generates references blocks for every set of refs that need it. As of HTML version 1.2.1, for all such auto-generated reference block, the data-mw will have the autoGenerated property set to true.

Responsive wrappers
In T159894, support was added for the cite extension's  parameter, which presents the references section as multiple columns based on the browser window size. This is achieved by wrapping the ordered list with a div. Of note, since this is part of the extension content, the transclusion annotations are placed on the wrapper.

Directionality
A  class is added to the reference list item based on the   attribute specified on the reference definition. For example, First one

Error representation
Cite does not inline the i18n error text in the HTML. It instead annotates the erroneous  with a   value in the typeof attribute and the i18n error key in the   property  as shown in the following excerpt: typeof="mw:Extension/ref mw:Error" data-mw='{"name":"ref","attrs":{"name":"example"},"errors":[{"key":"cite_error_ref_no_text"}]}' Clients like VisualEditor will need to recognize these new attributes and display the actual error message in the correct language with parameters such as the name expanded in the error message text.

As part of T51538 the full suite of error conditions provided by Core Cite extension are being added to Parsoid's Cite implementation. Parsoid's Cite implementation will use the same mechanism for annotating the other error types.

CSS based configuration
The display of footnotes, etc. are configured via CSS. This differs from the design of the legacy extension. See the announcement and task. FIXME: Say more ...