diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-02-27 00:40:33 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-02-27 00:40:33 +0100 |
commit | 4fb9976a9a9589799d66fe8df91128b8fb19d18f (patch) | |
tree | e0d940b7792d2e78e30dcdf7e46e2b8f5090a0c9 /src/Text/Pandoc | |
parent | 99b39ffc1726a86e6a6ad45ef6b81a28b46594ef (diff) | |
download | pandoc-4fb9976a9a9589799d66fe8df91128b8fb19d18f.tar.gz |
Minor cleanups in LaTeX reader.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 18c240e27..bbbd1fee0 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -445,22 +445,22 @@ inlineCommand :: PandocMonad m => LP m Inlines inlineCommand = try $ do (name, raw') <- withRaw anyControlSeq guard $ name /= "begin" && name /= "end" - exts <- getOption readerExtensions star <- option "" (string "*") let name' = name ++ star let raw = do + guard $ not (isBlockCommand name) rawargs <- withRaw - (skipangles *> skipopts *> option "" dimenarg *> many braced) + (skipangles *> skipopts *> option "" dimenarg *> many braced) let rawcommand = raw' ++ star ++ snd rawargs transformed <- applyMacros' rawcommand + exts <- getOption readerExtensions if transformed /= rawcommand then parseFromString inlines transformed else if extensionEnabled Ext_raw_tex exts then return $ rawInline "latex" rawcommand else ignore rawcommand - (lookupListDefault mzero [name',name] inlineCommands <* + (lookupListDefault raw [name',name] inlineCommands <* optional (try (string "{}"))) - <|> (guard (not (isBlockCommand name)) >> raw) unlessParseRaw :: PandocMonad m => LP m () unlessParseRaw = getOption readerExtensions >>= @@ -508,7 +508,6 @@ inlineCommands = M.fromList $ , ("sim", lit "~") , ("label", unlessParseRaw >> (inBrackets <$> tok)) , ("ref", unlessParseRaw >> (inBrackets <$> tok)) - , ("noindent", unlessParseRaw >> ignore "noindent") , ("textgreek", tok) , ("sep", lit ",") , ("cref", unlessParseRaw >> (inBrackets <$> tok)) -- from cleveref.sty |