summaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-01-20 19:21:13 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-01-20 19:21:13 -0800
commit9cc1cf1f4098ad6a22eedeaf8e6d846ce7fbf5c3 (patch)
tree8fcb570e2871d8fe1a7cd90a438b2a23def4682b /src/Text
parent00fe1dba311cab8a317c25986723be6122489dff (diff)
Fixed bug with escaped % in LaTeX reader.
Also added tests. Closes #710.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs2
1 files changed, 2 insertions, 0 deletions
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) =