summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-11-19 13:06:03 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-11-19 13:06:03 -0800
commit97efed8c23414bd85801538de7df42b9f38d1fe7 (patch)
treef4976ddea0eb91da86dee4e45c7f604ce2bae6d6 /src
parent82bcda80c6e8b9e6e4e6c707569df4f9022b042f (diff)
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`.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Parsing.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs
index d8418ed11..c86f6718a 100644
--- a/src/Text/Pandoc/Parsing.hs
+++ b/src/Text/Pandoc/Parsing.hs
@@ -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