aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/TeXMath.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-08-04 11:13:09 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-08-04 11:13:09 -0700
commit40d8100d440dd7924068d027e052f5a3de65e70f (patch)
tree6383616e5095559dbe9d02e9960a965dc69c5c53 /src/Text/Pandoc/Readers/TeXMath.hs
parent4630cff2a6c116f1d474f459e6e759f5ce7f2003 (diff)
downloadpandoc-40d8100d440dd7924068d027e052f5a3de65e70f.tar.gz
Use texmath 0.7 interface.
Diffstat (limited to 'src/Text/Pandoc/Readers/TeXMath.hs')
-rw-r--r--src/Text/Pandoc/Readers/TeXMath.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/TeXMath.hs b/src/Text/Pandoc/Readers/TeXMath.hs
index d7f982fb7..3fee3051e 100644
--- a/src/Text/Pandoc/Readers/TeXMath.hs
+++ b/src/Text/Pandoc/Readers/TeXMath.hs
@@ -38,9 +38,10 @@ import Text.TeXMath
texMathToInlines :: MathType
-> String -- ^ String to parse (assumes @'\n'@ line endings)
-> [Inline]
-texMathToInlines mt inp = case texMathToPandoc dt inp of
- Left _ -> [Str (delim ++ inp ++ delim)]
- Right res -> res
+texMathToInlines mt inp =
+ case writePandoc dt `fmap` readTeX inp of
+ Right (Just ils) -> ils
+ _ -> [Str (delim ++ inp ++ delim)]
where (dt, delim) = case mt of
DisplayMath -> (DisplayBlock, "$$")
InlineMath -> (DisplayInline, "$")