From 79dfd3be366486550735c772b4caeb1f789e3151 Mon Sep 17 00:00:00 2001 From: Noah Hellman Date: Thu, 19 Jan 2023 22:39:49 +0100 Subject: [PATCH] inline: do not merge discontinuous str may appear when ignoring attributes --- src/inline.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/inline.rs b/src/inline.rs index 2db3aac..afc71cd 100644 --- a/src/inline.rs +++ b/src/inline.rs @@ -662,10 +662,9 @@ impl + Clone> Iterator for Parser { matches!( e.kind, EventKind::Str | EventKind::Whitespace | EventKind::Placeholder - ) + ) && span.end() == e.span.start() }) { let ev = self.events.pop_front().unwrap(); - assert_eq!(span.end(), ev.span.start()); span = span.union(ev.span); } Some(Event { @@ -950,6 +949,7 @@ mod test { (Str, "abc"), (Exit(Span), "]"), ); + test_parse!("not a [span] {#id}.", (Str, "not a [span] "), (Str, ".")); } #[test]