diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-25 17:53:50 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-25 17:53:50 -0800 |
commit | 0801b120b9d9d406c523da90697950087b2f80bc (patch) | |
tree | 57aac44ed0a2b42cce3db60735f73a29cc824dd5 | |
parent | 286fc44bba0fac64c62f67f1efc4ddddd51896be (diff) | |
download | pandoc-0801b120b9d9d406c523da90697950087b2f80bc.tar.gz |
anyLine: Set position properly.
-rw-r--r-- | src/Text/Pandoc/Parsing.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs index 7a3c5f27b..4bb2aa6d2 100644 --- a/src/Text/Pandoc/Parsing.hs +++ b/src/Text/Pandoc/Parsing.hs @@ -194,8 +194,11 @@ anyLine = do -- This is much faster than: -- manyTill anyChar newline inp <- getInput + pos <- getPosition let (this, rest) = break (=='\n') inp setInput rest + let newpos = setSourceLine (setSourceColumn pos 0) (sourceLine pos + 1) + setPosition newpos void (char '\n') <|> (guard (not $ null this) >> eof) return this |