From 7bf7e86db9db89da11f80d2199bcd5ca7988efba Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Sat, 29 Oct 2022 12:25:32 +0200 Subject: Refactor to always resolve edit maps This will probably catch some confusing bugs, such as ad1b3e6. --- src/construct/partial_whitespace.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/construct/partial_whitespace.rs') diff --git a/src/construct/partial_whitespace.rs b/src/construct/partial_whitespace.rs index 8e58838..276c24e 100644 --- a/src/construct/partial_whitespace.rs +++ b/src/construct/partial_whitespace.rs @@ -67,8 +67,6 @@ use alloc::vec; /// Resolve whitespace. pub fn resolve_whitespace(tokenizer: &mut Tokenizer, hard_break: bool, trim_whole: bool) { - tokenizer.map.consume(&mut tokenizer.events); - let mut index = 0; while index < tokenizer.events.len() { @@ -86,6 +84,8 @@ pub fn resolve_whitespace(tokenizer: &mut Tokenizer, hard_break: bool, trim_whol index += 1; } + + tokenizer.map.consume(&mut tokenizer.events); } /// Trim a [`Data`][Name::Data] event. -- cgit