diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX/Macro.hs | 7 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX/Macro.hs b/src/Text/Pandoc/Readers/LaTeX/Macro.hs index bd7979ef3..c5704c8ad 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Macro.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Macro.hs @@ -79,10 +79,9 @@ letmacro = do checkGlobal :: PandocMonad m => LP m [(Text, Macro)] -> LP m [(Text, Macro)] checkGlobal p = - (do controlSeq "global" - ms <- p - return $ map (\(n, Macro _ expand arg optarg contents) -> - (n, Macro GlobalScope expand arg optarg contents)) ms) + (controlSeq "global" *> + (map (\(n, Macro _ expand arg optarg contents) -> + (n, Macro GlobalScope expand arg optarg contents)) <$> p)) <|> p edefmacro :: PandocMonad m => LP m [(Text, Macro)] diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs index e1b72926f..075e1f656 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs @@ -224,8 +224,8 @@ instance HasIncludeFiles LaTeXState where instance HasMacros LaTeXState where extractMacros st = NonEmpty.head $ sMacros st - updateMacros f st = st{ sMacros = f (NonEmpty.head $ sMacros st) - :| (NonEmpty.tail $ sMacros st) } + updateMacros f st = st{ sMacros = f (NonEmpty.head (sMacros st)) + :| NonEmpty.tail (sMacros st) } instance HasReaderOptions LaTeXState where extractReaderOptions = sOptions |