From 044d58bb24cf41493222a14612e2de4f8d05ea6a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 15 Dec 2017 09:45:29 -0800 Subject: Fixed regression in LateX tokenization. This mainly affects the Markdown reader when parsing raw LaTeX with escaped spaces. Closes #4159. --- src/Text/Pandoc/Readers/LaTeX.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 90d0fe5d1..fab97347b 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -320,7 +320,7 @@ totoks pos t = : totoks (incSourceColumn pos (1 + T.length cs)) rest' | c == '\\' -> case T.uncons rest of - Nothing -> [Tok pos Symbol (T.singleton c)] + Nothing -> [Tok pos (CtrlSeq " ") "\\"] Just (d, rest') | isLetterOrAt d -> -- \makeatletter is common in macro defs; @@ -338,7 +338,7 @@ totoks pos t = Just ('\n', r2) -> (T.pack "\n", T.span isSpaceOrTab r2) - _ -> (mempty, (w1, r1)) + _ -> (mempty, (mempty, r1)) in case T.uncons r3 of Just ('\n', _) -> Tok pos (CtrlSeq " ") ("\\" <> w1) -- cgit v1.2.3