aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-01-25 17:53:50 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-01-25 17:53:50 -0800
commit0801b120b9d9d406c523da90697950087b2f80bc (patch)
tree57aac44ed0a2b42cce3db60735f73a29cc824dd5 /src/Text
parent286fc44bba0fac64c62f67f1efc4ddddd51896be (diff)
downloadpandoc-0801b120b9d9d406c523da90697950087b2f80bc.tar.gz
anyLine: Set position properly.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Parsing.hs3
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