Skip to main content

HTML_FOOTNOTE_ATTR

Constant HTML_FOOTNOTE_ATTR 

Source
pub const HTML_FOOTNOTE_ATTR: &'static str;
Expand description

The attribute an HTML producer uses to say “this element is a footnote reference”, and the label it names.

A data attribute on an otherwise-ordinary element, rather than a literal [^label] in the text, because the text a producer emits is escaped on the way to Djot — escape_djot_inline neutralises [, ] and ^, so a reference smuggled through as characters arrives as \[\^1\] and is prose rather than a reference. It has to be a node before it is serialised, which is what this makes it.

ParsedSpan::footnote_ref is the same field the Markdown/Djot reader already fills, so everything downstream — the document model, the Djot writer, numbering — needs no change at all.