aboutsummaryrefslogtreecommitdiff
path: root/Text/Pandoc
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-09-06 21:24:33 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-09-06 21:24:33 +0000
commit5c029594835c531a3c66aad2b51872ec1f04541c (patch)
treefca2e7c09b4cde240acf5cb6c13f110ebfbb155b /Text/Pandoc
parent87aa45844666123283c39d28012f0a6fe44e4d8c (diff)
downloadpandoc-5c029594835c531a3c66aad2b51872ec1f04541c.tar.gz
LaTeX reader: Refactored math parsers, limited support for eqnarray.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1426 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Text/Pandoc')
-rw-r--r--Text/Pandoc/Readers/LaTeX.hs13
1 files changed, 10 insertions, 3 deletions
diff --git a/Text/Pandoc/Readers/LaTeX.hs b/Text/Pandoc/Readers/LaTeX.hs
index e1efce1e9..d2dff2d5a 100644
--- a/Text/Pandoc/Readers/LaTeX.hs
+++ b/Text/Pandoc/Readers/LaTeX.hs
@@ -687,13 +687,20 @@ math3 :: GenParser Char st String
math3 = try $ char '$' >> math1 >>~ char '$'
math4 :: GenParser Char st String
-math4 = try $ (begin "equation") >> spaces >> manyTill anyChar (end "equation")
+math4 = try $ do
+ name <- begin "equation" <|> begin "equation*" <|> begin "displaymath" <|> begin "displaymath*"
+ spaces
+ manyTill anyChar (end name)
math5 :: GenParser Char st String
-math5 = try $ (begin "displaymath") >> spaces >> manyTill anyChar (end "displaymath")
+math5 = try $ (string "\\[") >> spaces >> manyTill anyChar (try $ string "\\]")
math6 :: GenParser Char st String
-math6 = try $ (string "\\[") >> spaces >> manyTill anyChar (try $ string "\\]")
+math6 = try $ do
+ name <- begin "eqnarray" <|> begin "eqnarray*"
+ spaces
+ res <- manyTill anyChar (end name)
+ return $ filter (/= '&') res -- remove eqnarray alignment codes
--
-- links and images