From 685e90cd4f25e75d80b07b8fa9d3cd63f5999555 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 21 Dec 2017 11:50:55 -0800 Subject: LaTeX reader: Fixed subtle bug in tokenizer. Material following `^^` was dropped if it wasn't a character escape. This only affected invalid LaTeX, so we didn't see it in the wild, but it appeared in a QuickCheck test failure https://travis-ci.org/jgm/pandoc/jobs/319812224 --- src/Text/Pandoc/Readers/LaTeX.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index c82697704..e6ae4c11b 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -376,8 +376,9 @@ totoks pos t = | d < '\128' -> Tok pos Esc1 (T.pack ['^','^',d]) : totoks (incSourceColumn pos 3) rest'' - _ -> [Tok pos Symbol ("^"), - Tok (incSourceColumn pos 1) Symbol ("^")] + _ -> Tok pos Symbol ("^") : + Tok (incSourceColumn pos 1) Symbol ("^") : + totoks (incSourceColumn pos 2) rest' _ -> Tok pos Symbol ("^") : totoks (incSourceColumn pos 1) rest | otherwise -> -- cgit v1.2.3