Implement the new fields for LaTeX environment.
This commit is contained in:
parent
0b42139393
commit
175ff1e6c4
@ -57,7 +57,7 @@ where
|
|||||||
let (remaining, _end) = latex_environment_end_specialized(&parser_context, remaining)?;
|
let (remaining, _end) = latex_environment_end_specialized(&parser_context, remaining)?;
|
||||||
let value_end = remaining;
|
let value_end = remaining;
|
||||||
|
|
||||||
let (remaining, _trailing_ws) =
|
let (remaining, post_blank) =
|
||||||
maybe_consume_trailing_whitespace_if_not_exiting(context, remaining)?;
|
maybe_consume_trailing_whitespace_if_not_exiting(context, remaining)?;
|
||||||
let source = get_consumed(input, remaining);
|
let source = get_consumed(input, remaining);
|
||||||
let value = get_consumed(value_start, value_end);
|
let value = get_consumed(value_start, value_end);
|
||||||
@ -70,6 +70,7 @@ where
|
|||||||
affiliated_keywords,
|
affiliated_keywords,
|
||||||
),
|
),
|
||||||
value: value.into(),
|
value: value.into(),
|
||||||
|
post_blank: post_blank.map(Into::<&str>::into),
|
||||||
},
|
},
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
@ -173,6 +173,7 @@ pub struct LatexEnvironment<'s> {
|
|||||||
pub source: &'s str,
|
pub source: &'s str,
|
||||||
pub affiliated_keywords: AffiliatedKeywords<'s>,
|
pub affiliated_keywords: AffiliatedKeywords<'s>,
|
||||||
pub value: &'s str,
|
pub value: &'s str,
|
||||||
|
pub post_blank: Option<&'s str>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A line number used in switches to lesser blocks.
|
/// A line number used in switches to lesser blocks.
|
||||||
@ -425,11 +426,15 @@ impl<'s> StandardProperties<'s> for LatexEnvironment<'s> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_contents<'b>(&'b self) -> Option<&'s str> {
|
fn get_contents<'b>(&'b self) -> Option<&'s str> {
|
||||||
todo!()
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_post_blank(&self) -> PostBlank {
|
fn get_post_blank(&self) -> PostBlank {
|
||||||
todo!()
|
self.post_blank
|
||||||
|
.map(|text| text.lines().count())
|
||||||
|
.unwrap_or(0)
|
||||||
|
.try_into()
|
||||||
|
.expect("Too much post-blank to fit into a PostBlank.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user