block: store level in event

do not use span length as level
This commit is contained in:
Noah Hellman 2023-04-29 18:34:23 +02:00
parent 6abe9e44c7
commit bc4dd794bc
2 changed files with 187 additions and 30 deletions

View file

@ -881,8 +881,8 @@ impl<'s> Parser<'s> {
self.inline_parser.reset();
match l {
block::Leaf::Paragraph => Container::Paragraph,
block::Leaf::Heading { has_section } => Container::Heading {
level: content.len().try_into().unwrap(),
block::Leaf::Heading { level, has_section } => Container::Heading {
level,
has_section,
id: self
.pre_pass