diff --git a/src/parser/latex_fragment.rs b/src/parser/latex_fragment.rs index 0fc704b..e5b008a 100644 --- a/src/parser/latex_fragment.rs +++ b/src/parser/latex_fragment.rs @@ -202,17 +202,13 @@ fn bordered_dollar_fragment<'r, 's>( // TODO: I'm assuming I should be peeking at the borders but the documentation is not clear. Test to figure out. let (_, _) = peek(parser_with_context!(open_border)(context))(remaining)?; - // TODO: As an optimization it would be nice to exit early upon hitting the 3rd line break - let (remaining, _) = verify( - recognize(many_till( - anychar, - peek(alt(( - parser_with_context!(exit_matcher_parser)(context), - tag("$"), - ))), - )), - |body: &OrgSource<'_>| Into::<&str>::into(body).lines().take(4).count() <= 3, - )(remaining)?; + let (remaining, _) = recognize(many_till( + anychar, + peek(alt(( + parser_with_context!(exit_matcher_parser)(context), + tag("$"), + ))), + ))(remaining)?; let (_, _) = peek(parser_with_context!(close_border)(context))(remaining)?; let (remaining, _) = tag("$")(remaining)?;