aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-07-24 11:16:43 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-07-24 11:20:59 +0200
commit329b61ff5cbad6297d1ceea5da7f045613e27ec5 (patch)
tree579db1cd43fdde967070669d46e6e4324d189f3a /src/Text/Pandoc
parente7876d43203a4672e9d5bb10f91d1530272abc7b (diff)
downloadpandoc-329b61ff5cbad6297d1ceea5da7f045613e27ec5.tar.gz
LaTeX reader: support etoolbox's ifstrequal.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs13
1 files changed, 13 insertions, 0 deletions
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