Fix end conditions for subscript and superscript.
This commit is contained in:
parent
76a81b73ac
commit
69512f559a
@ -1,5 +1,6 @@
|
||||
use nom::branch::alt;
|
||||
use nom::bytes::complete::tag;
|
||||
use nom::bytes::complete::take_while;
|
||||
use nom::character::complete::anychar;
|
||||
use nom::character::complete::one_of;
|
||||
use nom::combinator::map;
|
||||
@ -9,6 +10,7 @@ use nom::combinator::peek;
|
||||
use nom::combinator::recognize;
|
||||
use nom::combinator::verify;
|
||||
use nom::multi::many_till;
|
||||
use nom::sequence::tuple;
|
||||
|
||||
use super::object_parser::standard_set_object;
|
||||
use super::org_source::BracketDepth;
|
||||
@ -143,7 +145,10 @@ fn script_alphanum_character<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, Org
|
||||
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
|
||||
fn end_script_alphanum_character<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, OrgSource<'s>> {
|
||||
let (remaining, final_char) = recognize(verify(anychar, |c| c.is_alphanumeric()))(input)?;
|
||||
peek(not(script_alphanum_character))(remaining)?;
|
||||
peek(tuple((
|
||||
take_while(|c| r#",.\"#.contains(c)),
|
||||
not(script_alphanum_character),
|
||||
)))(remaining)?;
|
||||
Ok((remaining, final_char))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user