Minor cleanup
This commit is contained in:
parent
46e0766a36
commit
24d44632e0
|
@ -195,6 +195,7 @@ fn space(input: Span) -> IResult<Span, Token> {
|
||||||
struct Context;
|
struct Context;
|
||||||
|
|
||||||
impl Context {
|
impl Context {
|
||||||
|
#[inline]
|
||||||
const fn partial<'a>(
|
const fn partial<'a>(
|
||||||
&self,
|
&self,
|
||||||
func: impl Fn(&Self, Span<'a>) -> IResult<Span<'a>, Token<'a>> + 'static,
|
func: impl Fn(&Self, Span<'a>) -> IResult<Span<'a>, Token<'a>> + 'static,
|
||||||
|
@ -278,22 +279,25 @@ impl Context {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tag_block_math<'a>(&self, input: Span<'a>) -> IResult<Span<'a>, Token<'a>> {
|
fn tag_block_math<'a>(&self, input: Span<'a>) -> IResult<Span<'a>, Token<'a>> {
|
||||||
|
let start = &tag("\\[");
|
||||||
|
let end = &tag("\\]");
|
||||||
|
|
||||||
let (input, _) = opt(line_ending)(input)?;
|
let (input, _) = opt(line_ending)(input)?;
|
||||||
|
|
||||||
if input.get_column() != 0 {
|
if input.get_column() != 0 {
|
||||||
return fail(input);
|
return fail(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
let (input, _) = tag("\\[")(input)?;
|
let (input, _) = start(input)?;
|
||||||
let (input, _) = opt(line_ending)(input)?;
|
let (input, _) = opt(line_ending)(input)?;
|
||||||
|
|
||||||
let (input, math_span) = recognize(many1_count(tuple((
|
let (input, math_span) = recognize(many1_count(tuple((
|
||||||
not(tuple((opt(line_ending), tag("\\]")))),
|
not(tuple((opt(line_ending), end))),
|
||||||
not_line_ending,
|
not_line_ending,
|
||||||
))))(input)?;
|
))))(input)?;
|
||||||
|
|
||||||
let (input, _) = opt(line_ending)(input)?;
|
let (input, _) = opt(line_ending)(input)?;
|
||||||
let (input, _) = tag("\\]")(input)?;
|
let (input, _) = end(input)?;
|
||||||
let (input, _) = many0(space)(input)?;
|
let (input, _) = many0(space)(input)?;
|
||||||
let (input, _) = not(not_line_ending)(input)?;
|
let (input, _) = not(not_line_ending)(input)?;
|
||||||
let (input, _) = opt(line_ending)(input)?;
|
let (input, _) = opt(line_ending)(input)?;
|
||||||
|
|
Loading…
Reference in New Issue