From 329b61ff5cbad6297d1ceea5da7f045613e27ec5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 24 Jul 2017 11:16:43 +0200 Subject: LaTeX reader: support etoolbox's ifstrequal. --- src/Text/Pandoc/Readers/LaTeX.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/Text/Pandoc/Readers') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 44be8dea3..494f532a1 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -1316,8 +1316,21 @@ inlineCommands = M.fromList $ , ("faClose", lit "\10007") -- xspace , ("xspace", doxspace) + -- etoolbox + , ("ifstrequal", ifstrequal) ] +ifstrequal :: PandocMonad m => LP m Inlines +ifstrequal = do + str1 <- tok + str2 <- tok + ifequal <- braced + ifnotequal <- braced + if str1 == str2 + then getInput >>= setInput . (ifequal ++) + else getInput >>= setInput . (ifnotequal ++) + return mempty + ttfamily :: PandocMonad m => LP m Inlines ttfamily = (code . stringify . toList) <$> tok -- cgit v1.2.3