lib: make div class non option

there is no distinction between an empty class and a None
This commit is contained in:
Noah Hellman 2023-05-10 23:33:21 +02:00
parent 116fb04725
commit 924a3c35bb
2 changed files with 13 additions and 16 deletions

View file

@ -270,7 +270,7 @@ pub enum Container<'s> {
/// A section belonging to a top level heading.
Section { id: CowStr<'s> },
/// A block-level divider element.
Div { class: Option<&'s str> },
Div { class: &'s str },
/// A paragraph.
Paragraph,
/// A heading.
@ -919,9 +919,7 @@ impl<'s> Parser<'s> {
}
block::Node::Container(c) => match c {
block::Container::Blockquote => Container::Blockquote,
block::Container::Div { .. } => Container::Div {
class: (!ev.span.is_empty()).then(|| content),
},
block::Container::Div => Container::Div { class: content },
block::Container::Footnote => Container::Footnote { label: content },
block::Container::List(block::ListKind { ty, tight }) => {
if matches!(ty, block::ListType::Description) {