block: parse captions

This commit is contained in:
Noah Hellman 2023-01-26 20:16:20 +01:00
commit 8339befe2f
3 changed files with 111 additions and 6 deletions

View file

@ -157,6 +157,7 @@ impl<'s, I: Iterator<Item = Event<'s>>, W: std::fmt::Write> Writer<'s, I, W> {
Container::Heading { level } => write!(self.out, "<h{}", level)?,
Container::TableCell { head: false, .. } => self.out.write_str("<td")?,
Container::TableCell { head: true, .. } => self.out.write_str("<th")?,
Container::Caption => self.out.write_str("<caption")?,
Container::DescriptionTerm => self.out.write_str("<dt")?,
Container::CodeBlock { .. } => self.out.write_str("<pre")?,
Container::Span | Container::Math { .. } => self.out.write_str("<span")?,
@ -338,6 +339,7 @@ impl<'s, I: Iterator<Item = Event<'s>>, W: std::fmt::Write> Writer<'s, I, W> {
Container::Heading { level } => write!(self.out, "</h{}>", level)?,
Container::TableCell { head: false, .. } => self.out.write_str("</td>")?,
Container::TableCell { head: true, .. } => self.out.write_str("</th>")?,
Container::Caption => self.out.write_str("</caption>")?,
Container::DescriptionTerm => self.out.write_str("</dt>")?,
Container::CodeBlock { .. } => self.out.write_str("</code></pre>")?,
Container::Span => self.out.write_str("</span>")?,