Skip to content

Commit 30ce7e7

Browse files
committed
Skip HTML comments in the summary
- Revert changes in parse_numbered(). They were unnecessary.
1 parent d402a12 commit 30ce7e7

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/book/summary.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,6 @@ impl<'a> SummaryParser<'a> {
365365
let mut first = true;
366366

367367
loop {
368-
let mut html_node = false;
369-
370368
match self.next_event() {
371369
Some(ev @ Event::Start(Tag::Paragraph)) => {
372370
if !first {
@@ -407,12 +405,6 @@ impl<'a> SummaryParser<'a> {
407405
items.push(SummaryItem::Separator);
408406
}
409407

410-
// A HTML node, such as a comment line... ignore, but set the html_node flag.
411-
Some(Event::Html(html)) => {
412-
trace!("Skipping a HTML node of {:?}", html);
413-
html_node = true;
414-
}
415-
416408
// something else... ignore
417409
Some(_) => {}
418410

@@ -422,10 +414,8 @@ impl<'a> SummaryParser<'a> {
422414
}
423415
}
424416

425-
// If the event was not a HTML node, we no longer accept any new paragraph opening tags.
426-
if !html_node {
427-
first = false;
428-
}
417+
// From now on, we cannot accept any new paragraph opening tags.
418+
first = false;
429419
}
430420

431421
Ok(items)

0 commit comments

Comments
 (0)