block: add hierarchical heading sections

This commit is contained in:
Noah Hellman 2023-01-28 18:12:45 +01:00
commit 530820a04e
3 changed files with 59 additions and 13 deletions

View file

@ -148,6 +148,7 @@ impl<'s, I: Iterator<Item = Event<'s>>, W: std::fmt::Write> Writer<'s, I, W> {
}
Container::Table => self.out.write_str("<table")?,
Container::TableRow { .. } => self.out.write_str("<tr")?,
Container::Section => self.out.write_str("<section")?,
Container::Div { .. } => self.out.write_str("<div")?,
Container::Paragraph => {
if matches!(self.list_tightness.last(), Some(true)) {
@ -311,6 +312,7 @@ impl<'s, I: Iterator<Item = Event<'s>>, W: std::fmt::Write> Writer<'s, I, W> {
}
Container::Table => self.out.write_str("</table>")?,
Container::TableRow { .. } => self.out.write_str("</tr>")?,
Container::Section => self.out.write_str("</section>")?,
Container::Div { .. } => self.out.write_str("</div>")?,
Container::Paragraph => {
if matches!(self.list_tightness.last(), Some(true)) {