Consuming trailing whitespace for 🔚 bullshitium.

This commit is contained in:
Tom Alexander 2023-10-18 12:17:57 -04:00
parent cf5d3ed745
commit 94dec31130
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

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