"); self.blocks(node, false)?; self.push(""); } Node::List(list) => { let tag = if list.ordered { "ol" } else { "ul" }; match list.start.filter(|start| list.ordered && *start != 1) { Some(start) => self.push(&format!("
"); self.inline(text, atoms); self.push("
"); } MarkdownBlock::Heading(depth, text) => { let at = node.position().expect("a parsed node has its place"); self.push(&format!("{}", escape(value)));
}
fn math(&mut self, line: usize, value: &str, display: bool) {
match (formula_svg(value, display), display) {
(Ok(svg), true) => self.push(&format!("{}", escape(value))),
}
}
}
}
/// A GitHub alert: its kind's title, then its blocks.
fn alert(&mut self, kind: AlertKind, body: &[Node]) -> io::Result<()> {
let (title, hue) = (kind.title(), hue(kind));
self.push(&format!(
"{title}
" )); for node in body { self.block(node, false)?; } self.push("