From 30ce7e79ac2c5c5355d5826c4f3b8f54ea8186d2 Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Mon, 5 Apr 2021 18:31:11 +0800 Subject: [PATCH] Skip HTML comments in the summary - Revert changes in parse_numbered(). They were unnecessary. --- src/book/summary.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/book/summary.rs b/src/book/summary.rs index 0d6f0c1e..8012e183 100644 --- a/src/book/summary.rs +++ b/src/book/summary.rs @@ -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,10 +414,8 @@ impl<'a> SummaryParser<'a> { } } - // If the event was not a HTML node, we no longer accept any new paragraph opening tags. - if !html_node { - first = false; - } + // From now on, we cannot accept any new paragraph opening tags. + first = false; } Ok(items)