Skip to content

Commit

Permalink
improve dollar sign math detection
Browse files Browse the repository at this point in the history
  • Loading branch information
fletcher committed Aug 19, 2013
1 parent 1c7e87f commit 9b9ad30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions parser.leg
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,14 @@ MathSpan = '\\' < (

SingleDollarMathStart = '$' !(Spacechar | Newline | '$' )

SingleDollarMathEnd = (!'\\' !'$' Nonspacechar) '$' !Nonspacechar
SingleDollarMathEnd = (!'\\' !'$' Nonspacechar) '$' !NonPunctuation

SingleDollarMath = < SingleDollarMathStart (!SingleDollarMathEnd !(BlankLine BlankLine) .)* SingleDollarMathEnd >
{ $$ = str(yytext); $$->key = MATHSPAN; }

DoubleDollarMathStart = '$' '$' !(Spacechar | Newline)

DoubleDollarMathEnd = (!'\\' Nonspacechar) '$' '$' !Nonspacechar
DoubleDollarMathEnd = (!'\\' Nonspacechar) '$' '$' !NonPunctuation

DoubleDollarMath = < DoubleDollarMathStart (!DoubleDollarMathEnd !(BlankLine BlankLine) .)* DoubleDollarMathEnd >
{ $$ = str(yytext); $$->key = MATHSPAN; }
Expand Down

0 comments on commit 9b9ad30

Please sign in to comment.