From e846c85188662b28573f8521adca806ed2f4f3cb Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 15 Dec 2023 19:17:16 -0500 Subject: [PATCH] Fix handling fixed width areas with empty lines in the middle. --- .../lesser_element/fixed_width_area/blank_line_in_middle.org | 3 +++ src/parser/fixed_width_area.rs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 org_mode_samples/lesser_element/fixed_width_area/blank_line_in_middle.org diff --git a/org_mode_samples/lesser_element/fixed_width_area/blank_line_in_middle.org b/org_mode_samples/lesser_element/fixed_width_area/blank_line_in_middle.org new file mode 100644 index 0000000..589a196 --- /dev/null +++ b/org_mode_samples/lesser_element/fixed_width_area/blank_line_in_middle.org @@ -0,0 +1,3 @@ +: foo +: +: bar diff --git a/src/parser/fixed_width_area.rs b/src/parser/fixed_width_area.rs index 9631ac8..10abff2 100644 --- a/src/parser/fixed_width_area.rs +++ b/src/parser/fixed_width_area.rs @@ -72,8 +72,8 @@ where fn fixed_width_area_line<'s>(input: OrgSource<'s>) -> Res, OrgSource<'s>> { start_of_line(input)?; let (remaining, _) = tuple((space0, tag(":")))(input)?; - if let Ok((remain, _line_break)) = org_line_ending(remaining) { - return Ok((remain, remaining.take(0))); + if let Ok((_remain, _line_break)) = org_line_ending(remaining) { + return Ok((remaining, remaining.take(0))); } let (remaining, _) = tag(" ")(remaining)?; let (remaining, value) = recognize(many_till(anychar, peek(org_line_ending)))(remaining)?;