From 9cc1cf1f4098ad6a22eedeaf8e6d846ce7fbf5c3 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 20 Jan 2013 19:21:13 -0800 Subject: Fixed bug with escaped % in LaTeX reader. Also added tests. Closes #710. --- src/Text/Pandoc/Readers/LaTeX.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 5362b1b53..05a71bd2b 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -690,6 +690,8 @@ handleIncludes = handleIncludes' [] -- parents parameter prevents infinite include loops handleIncludes' :: [FilePath] -> String -> IO String handleIncludes' _ [] = return [] +handleIncludes' parents ('\\':'%':xs) = + ("\\%"++) `fmap` handleIncludes' parents xs handleIncludes' parents ('%':xs) = handleIncludes' parents $ drop 1 $ dropWhile (/='\n') xs handleIncludes' parents ('\\':xs) = -- cgit v1.2.3