aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-12-21 11:50:55 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-12-21 11:50:55 -0800
commit685e90cd4f25e75d80b07b8fa9d3cd63f5999555 (patch)
treee46fb9c179dd6c6f66a65cf7e5a9ad764a0d309e /src
parent117a672c4da308f0b57dc9dff218a9dca443f1c4 (diff)
downloadpandoc-685e90cd4f25e75d80b07b8fa9d3cd63f5999555.tar.gz
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
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs5
1 files changed, 3 insertions, 2 deletions
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 ->