Yet more dangerously greedy Regexps in Maruku,
and one of my own.
This commit is contained in:
Jacques Distler 2009-03-27 09:25:08 -05:00
parent 7403ea6a6b
commit d425a70fad
5 changed files with 8 additions and 8 deletions

View file

@ -32,7 +32,7 @@ module Literal
class Math < AbstractLiteral
MATH_START = '(\${1,2}|' + Regexp.escape('\[') + '|\\begin\{equation\})'
MATH_END = '(\${1,2}|' + Regexp.escape('\]') + '|\\end\{equation\})'
MATH_PATTERN = Regexp.new(MATH_START + '([^$]|\\\$)+' + MATH_END, Regexp::MULTILINE)
MATH_PATTERN = Regexp.new(MATH_START + '([^$]|\\\$)+?' + MATH_END, Regexp::MULTILINE)
def self.pattern() MATH_PATTERN end
end