Skip HTML comments in the summary

- Revert changes in parse_numbered(). They were unnecessary.
This commit is contained in:
Tatsuya Kawano 2021-04-05 18:31:11 +08:00
parent d402a12e88
commit 30ce7e79ac
1 changed files with 2 additions and 12 deletions

View File

@ -365,8 +365,6 @@ impl<'a> SummaryParser<'a> {
let mut first = true;
loop {
let mut html_node = false;
match self.next_event() {
Some(ev @ Event::Start(Tag::Paragraph)) => {
if !first {
@ -407,12 +405,6 @@ impl<'a> SummaryParser<'a> {
items.push(SummaryItem::Separator);
}
// A HTML node, such as a comment line... ignore, but set the html_node flag.
Some(Event::Html(html)) => {
trace!("Skipping a HTML node of {:?}", html);
html_node = true;
}
// something else... ignore
Some(_) => {}
@ -422,11 +414,9 @@ impl<'a> SummaryParser<'a> {
}
}
// If the event was not a HTML node, we no longer accept any new paragraph opening tags.
if !html_node {
// From now on, we cannot accept any new paragraph opening tags.
first = false;
}
}
Ok(items)
}