git.iko.soy/typeable/pandoc
on master help sign in
Allow spaces after `\(` and before `\)` with `tex_math_single_backslash`.

Previously `\( \frac{1}{a} < \frac{1}{b} \)` was not parsed as math in `markdown` or `html` `+tex_math_single_backslash`.

commit97efed8c23414bd85801538de7df42b9f38d1fe7 authorJohn MacFarlane <jgm@berkeley.edu> dateSun 19 Nov 2017, 13:06 (9 years ago) parent82bcda8
1 file changed+2−2
src/Text/Pandoc/Parsing.hs+2−2
src/Text/Pandoc/Parsing.hs+2−2
@@ -586,7 +586,7 @@ uri = try $ do
586586mathInlineWith :: Stream s m Char => String -> String -> ParserT s st m String
587587mathInlineWith op cl = try $ do
588588 string op
589− notFollowedBy space
589+ when (op == "$") $ notFollowedBy space
590590 words' <- many1Till (count 1 (noneOf " \t\n\\")
591591 <|> (char '\\' >>
592592 -- This next clause is needed because \text{..} can
@@ -600,7 +600,7 @@ mathInlineWith op cl = try $ do
600600 return " "
601601 ) (try $ string cl)
602602 notFollowedBy digit -- to prevent capture of $5
603− return $ concat words'
603+ return $ trim $ concat words'
604604 where
605605 inBalancedBraces :: Stream s m Char => Int -> String -> ParserT s st m String
606606 inBalancedBraces 0 "" = do