diff options
Diffstat (limited to '')
-rw-r--r-- | src/content/document.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/content/document.rs b/src/content/document.rs index 0c95eed..0112d52 100644 --- a/src/content/document.rs +++ b/src/content/document.rs @@ -295,11 +295,26 @@ fn exit_containers( if info.stack.len() > size { // To do: inject these somewhere? Fix positions? println!("closing flow. To do: are these resulting exits okay?"); + let index = tokenizer.events.len(); let result = tokenizer.flush(info.next); info.next = Box::new(flow); // This is weird but Rust needs a function there. assert!(matches!(result.0, State::Ok)); assert!(result.1.is_none()); + let mut end = tokenizer.events.len(); + while end > 0 && end > index { + if tokenizer.events[end - 1].token_type != Token::LineEnding { + break; + } + + end -= 1; + } + + let mut add = tokenizer.events.drain(index..end).collect::<Vec<_>>(); + + println!("evs: {:#?}", add); + exits.append(&mut add); + println!(" setting `interrupt: false`"); tokenizer.interrupt = false; } |