inline: apply word attribute when flushing event buf

fixes issue with e.g `[text]({.cls})` where attributes get immediately
applied to `[text](` where link should have priority.
This commit is contained in:
Noah Hellman 2023-02-19 18:28:00 +01:00
parent 08ef15655b
commit 9454a2e393
2 changed files with 59 additions and 31 deletions

View file

@ -799,7 +799,7 @@ impl<'s> Parser<'s> {
let mut first_is_attr = false;
let mut attributes = inline.as_ref().map_or_else(Attributes::new, |inl| {
if let inline::EventKind::Attributes = inl.kind {
if let inline::EventKind::Attributes { .. } = inl.kind {
first_is_attr = true;
attr::parse(inl.span.of(self.src))
} else {
@ -911,7 +911,7 @@ impl<'s> Parser<'s> {
},
inline::EventKind::Str => Event::Str(inline.span.of(self.src).into()),
inline::EventKind::Whitespace
| inline::EventKind::Attributes
| inline::EventKind::Attributes { .. }
| inline::EventKind::Placeholder => {
panic!("{:?}", inline)
}