diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-01-13 22:04:26 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-01-13 22:04:55 -0800 |
commit | 485535464df27f5c2e2dd144650af318bde239c1 (patch) | |
tree | 21dff292e433e8d0abca452c850565943930fb65 /src | |
parent | 50b64bcf1c61e21402611d50fb23609b62b5c9c2 (diff) | |
download | pandoc-485535464df27f5c2e2dd144650af318bde239c1.tar.gz |
LaTeX reader: fixed pos calculation in tokenizing escaped space.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index d9b188606..d3f730259 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -333,13 +333,16 @@ totoks pos t = -> (T.pack "\n", T.span isSpaceOrTab r2) _ -> (mempty, (mempty, r1)) + ws = "\\" <> w1 <> w2 <> w3 in case T.uncons r3 of Just ('\n', _) -> Tok pos (CtrlSeq " ") ("\\" <> w1) - : totoks (incSourceColumn pos 1) r1 + : totoks (incSourceColumn pos (T.length ws)) + r1 _ -> - Tok pos (CtrlSeq " ") ("\\" <> w1 <> w2 <> w3) - : totoks (incSourceColumn pos 1) r3 + Tok pos (CtrlSeq " ") ws + : totoks (incSourceColumn pos (T.length ws)) + r3 | otherwise -> Tok pos (CtrlSeq (T.singleton d)) (T.pack [c,d]) : totoks (incSourceColumn pos 2) rest' |