git.iko.soy/typeable/pandoc
on master help sign in
anyLine: Set position properly.
commit0801b120b9d9d406c523da90697950087b2f80bc authorJohn MacFarlane <fiddlosopher@gmail.com> dateFri 25 Jan 2013, 17:53 (14 years ago) parent286fc44
1 file changed+3
src/Text/Pandoc/Parsing.hs+3
src/Text/Pandoc/Parsing.hs+3
@@ -194,8 +194,11 @@ anyLine = do
194194 -- This is much faster than:
195195 -- manyTill anyChar newline
196196 inp <- getInput
197+ pos <- getPosition
197198 let (this, rest) = break (=='\n') inp
198199 setInput rest
200+ let newpos = setSourceLine (setSourceColumn pos 0) (sourceLine pos + 1)
201+ setPosition newpos
199202 void (char '\n') <|> (guard (not $ null this) >> eof)
200203 return this
201204