parser: throw away link-def/footnote attrs
prevent attributes on link definitions and footnotes from applying to upcoming elements
This commit is contained in:
parent
2e4a9147aa
commit
9fd10683c5
1 changed files with 2 additions and 2 deletions
|
@ -532,6 +532,7 @@ impl<'s> Parser<'s> {
|
||||||
if enter {
|
if enter {
|
||||||
self.tree.take_inlines().last();
|
self.tree.take_inlines().last();
|
||||||
}
|
}
|
||||||
|
attributes = Attributes::new();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if enter {
|
if enter {
|
||||||
|
@ -569,6 +570,7 @@ impl<'s> Parser<'s> {
|
||||||
block::Container::Footnote => {
|
block::Container::Footnote => {
|
||||||
assert!(enter);
|
assert!(enter);
|
||||||
self.footnotes.insert(content, self.tree.take_branch());
|
self.footnotes.insert(content, self.tree.take_branch());
|
||||||
|
attributes = Attributes::new();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
block::Container::DescriptionList => Container::DescriptionList,
|
block::Container::DescriptionList => Container::DescriptionList,
|
||||||
|
@ -935,7 +937,6 @@ mod test {
|
||||||
"\n",
|
"\n",
|
||||||
"{a=b}\n",
|
"{a=b}\n",
|
||||||
"[tag]: url\n",
|
"[tag]: url\n",
|
||||||
"\n",
|
|
||||||
"para\n",
|
"para\n",
|
||||||
),
|
),
|
||||||
Start(Paragraph, Attributes::new()),
|
Start(Paragraph, Attributes::new()),
|
||||||
|
@ -947,7 +948,6 @@ mod test {
|
||||||
End(Link("url".into(), LinkType::Span(SpanLinkType::Reference))),
|
End(Link("url".into(), LinkType::Span(SpanLinkType::Reference))),
|
||||||
End(Paragraph),
|
End(Paragraph),
|
||||||
Atom(Blankline),
|
Atom(Blankline),
|
||||||
Atom(Blankline),
|
|
||||||
Start(Paragraph, Attributes::new()),
|
Start(Paragraph, Attributes::new()),
|
||||||
Str("para".into()),
|
Str("para".into()),
|
||||||
End(Paragraph),
|
End(Paragraph),
|
||||||
|
|
Loading…
Reference in a new issue