pub struct ParsedSpan {
pub text: String,
pub bold: bool,
pub italic: bool,
pub underline: bool,
pub strikeout: bool,
pub code: bool,
pub superscript: bool,
pub subscript: bool,
pub link_href: Option<String>,
pub image: Option<ParsedImage>,
pub footnote_ref: Option<String>,
pub preserve_whitespace: bool,
}Expand description
A parsed inline span with formatting info.
A span carries either text or an image, never both: an image span’s text
is empty and its description lives in ParsedImage::alt, so alt text
cannot leak into the block’s prose (and therefore cannot be counted as
manuscript words or matched by a search).
Fields§
§text: String§bold: bool§italic: bool§underline: bool§strikeout: bool§code: bool§superscript: boolSuperscript (djot ^x^). Maps to CharVerticalAlignment::SuperScript.
subscript: boolSubscript (djot ~x~). Maps to CharVerticalAlignment::SubScript.
link_href: Option<String>§image: Option<ParsedImage>Set when this span is an inline image rather than text.
footnote_ref: Option<String>Set when this span is a footnote reference rather than text — the label naming the note, never the number a reader sees.
preserve_whitespace: boolThe text keeps its whitespace as it is: it came from an element styled
white-space: pre, pre-wrap or break-spaces, where a tab or two spaces in a
row are the text’s own. An HTML reader collapses none of it.