From 0801b120b9d9d406c523da90697950087b2f80bc Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 25 Jan 2013 17:53:50 -0800 Subject: anyLine: Set position properly. --- src/Text/Pandoc/Parsing.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Text') 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 -- cgit v1.2.3