Skip HTML comments in the summary
- Revert changes in parse_numbered(). They were unnecessary.
This commit is contained in:
parent
d402a12e88
commit
30ce7e79ac
|
@ -365,8 +365,6 @@ impl<'a> SummaryParser<'a> {
|
||||||
let mut first = true;
|
let mut first = true;
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let mut html_node = false;
|
|
||||||
|
|
||||||
match self.next_event() {
|
match self.next_event() {
|
||||||
Some(ev @ Event::Start(Tag::Paragraph)) => {
|
Some(ev @ Event::Start(Tag::Paragraph)) => {
|
||||||
if !first {
|
if !first {
|
||||||
|
@ -407,12 +405,6 @@ impl<'a> SummaryParser<'a> {
|
||||||
items.push(SummaryItem::Separator);
|
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
|
// something else... ignore
|
||||||
Some(_) => {}
|
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.
|
// From now on, we cannot accept any new paragraph opening tags.
|
||||||
if !html_node {
|
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Ok(items)
|
Ok(items)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue