From 6c1f9c8e39d74217319957395de98b4d6a4bc840 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sun, 30 Dec 2007 02:07:55 +0000 Subject: Made LaTeX reader properly recognize --parse-raw in rawLaTeXInline. Updated LaTeX reader test to use --parse-raw. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1160 788f1e2b-df1e-0410-8736-df70ead52e1b --- Text/Pandoc/Readers/LaTeX.hs | 6 ++++-- tests/runtests.pl | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Text/Pandoc/Readers/LaTeX.hs b/Text/Pandoc/Readers/LaTeX.hs index ac338c106..dcfa62b92 100644 --- a/Text/Pandoc/Readers/LaTeX.hs +++ b/Text/Pandoc/Readers/LaTeX.hs @@ -374,7 +374,7 @@ unknownCommand = try $ do state <- getState if name == "item" && (stateParserContext state) == ListItemState then fail "should not be parsed as raw" - else string "" + else return "" if stateParseRaw state then return $ Plain [TeX ("\\" ++ name ++ star ++ argStr)] else return $ Plain [Str (joinWithSep " " args)] @@ -648,5 +648,7 @@ rawLaTeXInline = try $ do if ((name == "begin") || (name == "end") || (name == "item")) then fail "not an inline command" else string "" - return $ TeX ("\\" ++ name ++ star ++ concat args) + if stateParseRaw state + then return $ TeX ("\\" ++ name ++ star ++ concat args) + else return $ Str (joinWithSep " " args) diff --git a/tests/runtests.pl b/tests/runtests.pl index 6fd989930..bea5bf530 100644 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -99,7 +99,7 @@ print "Testing html reader..."; test_results("html reader", "tmp.native", "html-reader.native"); print "Testing latex reader..."; -`$script -r latex -w native -s latex-reader.latex > tmp.native`; +`$script -r latex -w native -R -s latex-reader.latex > tmp.native`; test_results("latex reader", "tmp.native", "latex-reader.native"); print "Testing native reader..."; -- cgit v1.2.3