diff options
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 2 | ||||
-rw-r--r-- | tests/latex-reader.latex | 4 | ||||
-rw-r--r-- | tests/latex-reader.native | 4 |
3 files changed, 9 insertions, 1 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) = diff --git a/tests/latex-reader.latex b/tests/latex-reader.latex index a1a4909d5..2ebdfed99 100644 --- a/tests/latex-reader.latex +++ b/tests/latex-reader.latex @@ -841,4 +841,8 @@ Notes can go in quotes.\footnote{ In quote. This paragraph should not be part of the note, as it is not indented. +\section{Escaped characters} + +\$ \% \& \# \_ \{ \} + \end{document} diff --git a/tests/latex-reader.native b/tests/latex-reader.native index 014852249..28bbad89c 100644 --- a/tests/latex-reader.native +++ b/tests/latex-reader.native @@ -370,4 +370,6 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite"], docA [Para [Str "Notes",Space,Str "can",Space,Str "go",Space,Str "in",Space,Str "quotes.",Note [Para [Str "In",Space,Str "quote."]]]] ,OrderedList (1,Decimal,Period) [[Para [Str "And",Space,Str "in",Space,Str "list",Space,Str "items.",Note [Para [Str "In",Space,Str "list."]]]]] -,Para [Str "This",Space,Str "paragraph",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "part",Space,Str "of",Space,Str "the",Space,Str "note,",Space,Str "as",Space,Str "it",Space,Str "is",Space,Str "not",Space,Str "indented."]] +,Para [Str "This",Space,Str "paragraph",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "part",Space,Str "of",Space,Str "the",Space,Str "note,",Space,Str "as",Space,Str "it",Space,Str "is",Space,Str "not",Space,Str "indented."] +,Header 1 ("",[],[]) [Str "Escaped",Space,Str "characters"] +,Para [Str "$",Space,Str "%",Space,Str "&",Space,Str "#",Space,Str "_",Space,Str "{",Space,Str "}"]] |