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`.
This commit is contained in:
John MacFarlane 2017-11-19 13:06:03 -08:00
parent 82bcda80c6
commit 97efed8c23

View file

@ -586,7 +586,7 @@ uri = try $ do
mathInlineWith :: Stream s m Char => String -> String -> ParserT s st m String
mathInlineWith op cl = try $ do
string op
notFollowedBy space
when (op == "$") $ notFollowedBy space
words' <- many1Till (count 1 (noneOf " \t\n\\")
<|> (char '\\' >>
-- This next clause is needed because \text{..} can
@ -600,7 +600,7 @@ mathInlineWith op cl = try $ do
return " "
) (try $ string cl)
notFollowedBy digit -- to prevent capture of $5
return $ concat words'
return $ trim $ concat words'
where
inBalancedBraces :: Stream s m Char => Int -> String -> ParserT s st m String
inBalancedBraces 0 "" = do