From f1eb1ab9cf6678cabbdb5b312bbd757ed32d8a76 Mon Sep 17 00:00:00 2001 From: Nikolay Yakimov Date: Tue, 31 Mar 2015 14:32:42 +0300 Subject: Latex Reader: Block commands code cleanup --- src/Text/Pandoc/Readers/LaTeX.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc/Readers') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 31a4c7c5c..2886e2f29 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -253,10 +253,9 @@ blockCommand = try $ do let raw = do rawcommand <- getRawCommand name' transformed <- applyMacros' rawcommand + guard $ transformed /= rawcommand notFollowedBy $ parseFromString inlines transformed - if transformed /= rawcommand - then parseFromString blocks transformed - else mzero + parseFromString blocks transformed case M.lookup name' blockCommands of Just p -> p Nothing -> case M.lookup name blockCommands of -- cgit v1.2.3