aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/partial_whitespace.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-29 12:25:32 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-29 12:25:32 +0200
commit7bf7e86db9db89da11f80d2199bcd5ca7988efba (patch)
tree24e13a4ed3bb7178907676cbbf2dbd2756c4f047 /src/construct/partial_whitespace.rs
parent5d5e94567e7a87a3cefdda410e3bd9e36e26eca5 (diff)
downloadmarkdown-rs-7bf7e86db9db89da11f80d2199bcd5ca7988efba.tar.gz
markdown-rs-7bf7e86db9db89da11f80d2199bcd5ca7988efba.tar.bz2
markdown-rs-7bf7e86db9db89da11f80d2199bcd5ca7988efba.zip
Refactor to always resolve edit maps
This will probably catch some confusing bugs, such as ad1b3e6.
Diffstat (limited to 'src/construct/partial_whitespace.rs')
-rw-r--r--src/construct/partial_whitespace.rs4
1 files changed, 2 insertions, 2 deletions
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.