Specs/HTML/2.1.0/Extensions/Cite

Changes since Specs/HTML/1.6.0/Extensions/Cite

 * T198221: Support directionality for reference

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 Parsoid 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, Parsoid 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, Parsoid 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

Parsoids Cite extension is changing how errors are handled and error information is encoded for clients to use.[edit]
The first two errors Parsoid Cite handles are refs without name or content, and named refs without content. Those two errors are reported by Core Cite extension at the reference for refs with out name and content, and in the reference area for named refs without content. Parsoid Cite no longer inserts the actual i18n error text and instead annotates the erring refs html with "mw:Error" in the typeof attribute and the i18n error key in the data-mw attributes 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"}]}' It leaves the HTML without explicitly visible error information and creates a properly formed, but empty content reference and leaves how to indicate and correct the error to the client such as Visual Editor, which will need to be enhanced 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.

The full suite of error conditions provided by Core Cite extension are being added to Parsoid Cite extension and will use the same mechanism for annotating the other error types.