Implement the new fields for bullshitium broken dynamic block.

This commit is contained in:
Tom Alexander 2023-12-15 18:04:42 -05:00
parent c28d8ccea4
commit f5280a3090
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -124,6 +124,7 @@ pub(crate) fn broken_dynamic_block<'b, 'g, 'r, 's>(
match paragraph.children.first_mut() {
Some(Object::PlainText(plain_text)) => {
plain_text.source = input.get_until_end_of_str(plain_text.source).into();
paragraph.contents = Some(input.get_until_end_of_str(plain_text.source).into());
}
Some(obj) => {
panic!("Unhandled first object type inside bullshitium {:?}", obj);
@ -134,14 +135,18 @@ pub(crate) fn broken_dynamic_block<'b, 'g, 'r, 's>(
};
Ok((remaining, paragraph))
} else {
let (remaining, _trailing_ws) =
let (remaining, post_blank) =
maybe_consume_trailing_whitespace_if_not_exiting(context, lead_in_remaining)?;
let body = Into::<&str>::into(input.get_until(lead_in_remaining));
Ok((
remaining,
Paragraph::of_text(
Paragraph::of_text_full(
input.get_until(remaining).into(),
input.get_until(lead_in_remaining).into(),
body,
if body.len() > 0 { Some(body) } else { None },
post_blank.map(Into::<&str>::into),
),
))
}