From 03028889bd081c351728369e08fd272c55242b09 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Wed, 4 Oct 2023 11:34:01 -0400 Subject: [PATCH] Fix capturing trailing whitespace for switches. --- src/parser/lesser_block.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/parser/lesser_block.rs b/src/parser/lesser_block.rs index 340a1def..77515e3b 100644 --- a/src/parser/lesser_block.rs +++ b/src/parser/lesser_block.rs @@ -328,10 +328,13 @@ enum SwitchState { #[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))] fn example_switches<'s>(input: OrgSource<'s>) -> Res, ExampleSwitches<'s>> { let mut number_lines = None; - let (remaining, (source, words)) = consumed(separated_list1( - space1, - map(is_not(" \t\r\n"), |val| Into::<&str>::into(val)), - ))(input)?; + let (remaining, (source, (words, _))) = consumed(tuple(( + separated_list1( + space1, + map(is_not(" \t\r\n"), |val| Into::<&str>::into(val)), + ), + space0, + )))(input)?; let mut state = SwitchState::Normal; for word in words {