inline: do not merge discontinuous str
may appear when ignoring attributes
This commit is contained in:
parent
d3b2ee14cb
commit
79dfd3be36
1 changed files with 2 additions and 2 deletions
|
@ -662,10 +662,9 @@ impl<I: Iterator<Item = char> + Clone> Iterator for Parser<I> {
|
||||||
matches!(
|
matches!(
|
||||||
e.kind,
|
e.kind,
|
||||||
EventKind::Str | EventKind::Whitespace | EventKind::Placeholder
|
EventKind::Str | EventKind::Whitespace | EventKind::Placeholder
|
||||||
)
|
) && span.end() == e.span.start()
|
||||||
}) {
|
}) {
|
||||||
let ev = self.events.pop_front().unwrap();
|
let ev = self.events.pop_front().unwrap();
|
||||||
assert_eq!(span.end(), ev.span.start());
|
|
||||||
span = span.union(ev.span);
|
span = span.union(ev.span);
|
||||||
}
|
}
|
||||||
Some(Event {
|
Some(Event {
|
||||||
|
@ -950,6 +949,7 @@ mod test {
|
||||||
(Str, "abc"),
|
(Str, "abc"),
|
||||||
(Exit(Span), "]"),
|
(Exit(Span), "]"),
|
||||||
);
|
);
|
||||||
|
test_parse!("not a [span] {#id}.", (Str, "not a [span] "), (Str, "."));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Reference in a new issue