Text markup uses confine context.

This commit is contained in:
Tom Alexander
2023-10-09 20:36:38 -04:00
parent 25531cc443
commit ee1d8ca321
3 changed files with 27 additions and 50 deletions

View File

@@ -57,20 +57,6 @@ pub(crate) fn immediate_in_section<'b, 'g, 'r, 's, 'x>(
false
}
/// Check if we are below a section of the given section type regardless of depth
pub(crate) fn in_object_section<'b, 'g, 'r, 's, 'x>(
context: RefContext<'b, 'g, 'r, 's>,
section_name: &'x str,
) -> bool {
for thing in context.iter() {
match thing {
ContextElement::ContextObject(name) if *name == section_name => return true,
_ => {}
}
}
false
}
/// Get a slice of the string that was consumed in a parser using the original input to the parser and the remaining input after the parser.
pub(crate) fn get_consumed<'s>(input: OrgSource<'s>, remaining: OrgSource<'s>) -> OrgSource<'s> {
input.get_until(remaining)