LaTeX reader: be more forgiving in parsing command options.

This was needed, for example, to make some minted options work.
This commit is contained in:
John MacFarlane 2017-10-19 15:58:12 -07:00
parent f615d7bb98
commit 21328a8771

View file

@ -769,7 +769,7 @@ dolstinline = do
keyval :: PandocMonad m => LP m (String, String) keyval :: PandocMonad m => LP m (String, String)
keyval = try $ do keyval = try $ do
Tok _ Word key <- satisfyTok isWordTok Tok _ Word key <- satisfyTok isWordTok
let isSpecSym (Tok _ Symbol t) = t `elem` [".",":","-","|","\\"] let isSpecSym (Tok _ Symbol t) = t /= "]" && t /= ","
isSpecSym _ = False isSpecSym _ = False
optional sp optional sp
val <- option [] $ do val <- option [] $ do
@ -2095,7 +2095,7 @@ environments = M.fromList
, ("BVerbatim", fancyverbEnv "BVerbatim") , ("BVerbatim", fancyverbEnv "BVerbatim")
, ("lstlisting", do attr <- parseListingsOptions <$> option [] keyvals , ("lstlisting", do attr <- parseListingsOptions <$> option [] keyvals
codeBlockWith attr <$> verbEnv "lstlisting") codeBlockWith attr <$> verbEnv "lstlisting")
, ("minted", minted) , ("minted", minted)
, ("obeylines", obeylines) , ("obeylines", obeylines)
, ("displaymath", mathEnvWith para Nothing "displaymath") , ("displaymath", mathEnvWith para Nothing "displaymath")
, ("equation", mathEnvWith para Nothing "equation") , ("equation", mathEnvWith para Nothing "equation")