Convert a ParsedSpan (parser output) into the CharacterFormat used by
FormatRun. is_code_block forces monospace as the font family for
every span inside a code block.
Whether a paragraph’s line ends before rest, the inline content after a run of its
text: the ends_line of that run (see push_html_text). It does when nothing but
empty content follows, or when the next text starts a line.
Whether the text of a paragraph’s line, text added to what came before it on its
line, ends in whitespace an HTML reader would collapse a space after it into: the
after_space of the run after it (see push_html_text). after_space says the same
of the text before text, and is the answer when text is empty.
Write text, a run of a paragraph’s text, into out as HTML: each of its lines (it
separates them with LINE_SEPARATOR) escaped by escape, the lines joined by
line_break, and a line whose whitespace an HTML reader would collapse put in a
<span style="white-space: pre-wrap">, where browsers, Qt and this crate’s own HTML
reader keep it as it is.
The checkbox an HTML list item opens with when it is a task, nothing otherwise, inside
the <label> that names it: the item’s text, which task_checkbox_end_html closes the
label after, is the checkbox’s accessible name (a bare checkbox reads as “checkbox,
checked” and the text as another item). Written as well-formed XML (disabled="disabled",
a closed tag) because the same markup is packaged into EPUB XHTML chapters, which a
minimised attribute and an unclosed input would break in a strict reader. Shared by the
two HTML writers; html_item_checkbox reads it back, through the label.