diff --git a/src/parser/bullshitium.rs b/src/parser/bullshitium.rs index 10f5694..3a7afc0 100644 --- a/src/parser/bullshitium.rs +++ b/src/parser/bullshitium.rs @@ -3,13 +3,16 @@ use nom::character::complete::space0; use nom::sequence::tuple; use super::paragraph::paragraph; +use super::util::maybe_consume_trailing_whitespace_if_not_exiting; use super::util::org_line_ending; use super::util::start_of_line; use super::OrgSource; use crate::context::RefContext; use crate::error::Res; +use crate::types::AffiliatedKeywords; use crate::types::Object; use crate::types::Paragraph; +use crate::types::PlainText; #[cfg_attr( feature = "tracing", @@ -62,9 +65,18 @@ pub(crate) fn broken_end<'b, 'g, 'r, 's>( }; Ok((remaining, paragraph)) } else { + let (remaining, _trailing_ws) = + maybe_consume_trailing_whitespace_if_not_exiting(context, lead_in_remaining)?; + Ok(( - lead_in_remaining, - Paragraph::of_text(input.get_until(lead_in_remaining).into()), + remaining, + Paragraph { + source: input.get_until(remaining).into(), + affiliated_keywords: AffiliatedKeywords::default(), + children: vec![Object::PlainText(PlainText { + source: input.get_until(lead_in_remaining).into(), + })], + }, )) } }