Compare commits

..

No commits in common. "175ff1e6c4556d394ac1b39ee4d90abcb584ee77" and "f141a4e186d648a144a431fcaae54e3b175e5632" have entirely different histories.

6 changed files with 12 additions and 36 deletions

View File

@ -39,7 +39,7 @@ pub(crate) fn export_snippet<'b, 'g, 'r, 's>(
parser_with_context!(contents)(&parser_context),
)))(remaining)?;
let (remaining, _) = tag("@@")(remaining)?;
let (remaining, post_blank) =
let (remaining, _trailing_whitespace) =
maybe_consume_object_trailing_whitespace_if_not_exiting(context, remaining)?;
let source = get_consumed(input, remaining);
Ok((
@ -48,7 +48,6 @@ pub(crate) fn export_snippet<'b, 'g, 'r, 's>(
source: source.into(),
backend: backend_name.into(),
contents: backend_contents.map(|(_colon, backend_contents)| backend_contents.into()),
post_blank: post_blank.map(Into::<&str>::into),
},
))
}

View File

@ -38,7 +38,7 @@ pub(crate) fn inline_babel_call<'b, 'g, 'r, 's>(
let (remaining, arguments) = argument(context, remaining)?;
let (remaining, end_header) = opt(parser_with_context!(header)(context))(remaining)?;
let value = get_consumed(input, remaining);
let (remaining, post_blank) =
let (remaining, _trailing_whitespace) =
maybe_consume_object_trailing_whitespace_if_not_exiting(context, remaining)?;
let source = get_consumed(input, remaining);
Ok((
@ -54,7 +54,6 @@ pub(crate) fn inline_babel_call<'b, 'g, 'r, 's>(
None
},
end_header: end_header.map(Into::<&str>::into),
post_blank: post_blank.map(Into::<&str>::into),
},
))
}

View File

@ -38,7 +38,7 @@ pub(crate) fn inline_source_block<'b, 'g, 'r, 's>(
let (remaining, language) = lang(context, remaining)?;
let (remaining, parameters) = opt(parser_with_context!(header)(context))(remaining)?;
let (remaining, value) = body(context, remaining)?;
let (remaining, post_blank) =
let (remaining, _trailing_whitespace) =
maybe_consume_object_trailing_whitespace_if_not_exiting(context, remaining)?;
let source = get_consumed(input, remaining);
Ok((
@ -48,7 +48,6 @@ pub(crate) fn inline_source_block<'b, 'g, 'r, 's>(
language: language.into(),
parameters: parameters.map(Into::<&str>::into),
value: value.into(),
post_blank: post_blank.map(Into::<&str>::into),
},
))
}

View File

@ -57,7 +57,7 @@ where
let (remaining, _end) = latex_environment_end_specialized(&parser_context, remaining)?;
let value_end = remaining;
let (remaining, post_blank) =
let (remaining, _trailing_ws) =
maybe_consume_trailing_whitespace_if_not_exiting(context, remaining)?;
let source = get_consumed(input, remaining);
let value = get_consumed(value_start, value_end);
@ -70,7 +70,6 @@ where
affiliated_keywords,
),
value: value.into(),
post_blank: post_blank.map(Into::<&str>::into),
},
))
}

View File

@ -173,7 +173,6 @@ pub struct LatexEnvironment<'s> {
pub source: &'s str,
pub affiliated_keywords: AffiliatedKeywords<'s>,
pub value: &'s str,
pub post_blank: Option<&'s str>,
}
/// A line number used in switches to lesser blocks.
@ -426,15 +425,11 @@ impl<'s> StandardProperties<'s> for LatexEnvironment<'s> {
}
fn get_contents<'b>(&'b self) -> Option<&'s str> {
None
todo!()
}
fn get_post_blank(&self) -> PostBlank {
self.post_blank
.map(|text| text.lines().count())
.unwrap_or(0)
.try_into()
.expect("Too much post-blank to fit into a PostBlank.")
todo!()
}
}

View File

@ -206,7 +206,6 @@ pub struct ExportSnippet<'s> {
pub source: &'s str,
pub backend: &'s str,
pub contents: Option<&'s str>,
pub post_blank: Option<&'s str>,
}
#[derive(Debug)]
@ -245,7 +244,6 @@ pub struct InlineBabelCall<'s> {
pub inside_header: Option<&'s str>,
pub arguments: Option<&'s str>,
pub end_header: Option<&'s str>,
pub post_blank: Option<&'s str>,
}
#[derive(Debug)]
@ -254,7 +252,6 @@ pub struct InlineSourceBlock<'s> {
pub language: &'s str,
pub parameters: Option<&'s str>,
pub value: &'s str,
pub post_blank: Option<&'s str>,
}
#[derive(Debug)]
@ -805,15 +802,11 @@ impl<'s> StandardProperties<'s> for ExportSnippet<'s> {
}
fn get_contents<'b>(&'b self) -> Option<&'s str> {
None
todo!()
}
fn get_post_blank(&self) -> PostBlank {
self.post_blank
.map(|text| text.chars().count())
.unwrap_or(0)
.try_into()
.expect("Too much post-blank to fit into a PostBlank.")
todo!()
}
}
@ -873,15 +866,11 @@ impl<'s> StandardProperties<'s> for InlineBabelCall<'s> {
}
fn get_contents<'b>(&'b self) -> Option<&'s str> {
None
todo!()
}
fn get_post_blank(&self) -> PostBlank {
self.post_blank
.map(|text| text.chars().count())
.unwrap_or(0)
.try_into()
.expect("Too much post-blank to fit into a PostBlank.")
todo!()
}
}
@ -891,15 +880,11 @@ impl<'s> StandardProperties<'s> for InlineSourceBlock<'s> {
}
fn get_contents<'b>(&'b self) -> Option<&'s str> {
None
todo!()
}
fn get_post_blank(&self) -> PostBlank {
self.post_blank
.map(|text| text.chars().count())
.unwrap_or(0)
.try_into()
.expect("Too much post-blank to fit into a PostBlank.")
todo!()
}
}