summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-04-22 04:19:34 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-04-22 04:19:34 +0000
commit726685af1b21d022784758b62c9f5da14c46a055 (patch)
treef3d586328e3df2bd1ba4cb306c40e3f2df3cacef /src
parent7742301c0921048afb97ba3ea5b55ecaf997298a (diff)
Fixed bug in anyLine parser. Previously anyLine would parse an
empty string "". But it should fail on an empty string, or we get an error from its use inside "many" combinators. git-svn-id: https://pandoc.googlecode.com/svn/trunk@587 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src')
-rw-r--r--src/Text/ParserCombinators/Pandoc.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/ParserCombinators/Pandoc.hs b/src/Text/ParserCombinators/Pandoc.hs
index cbccdcf1c..c87df2f78 100644
--- a/src/Text/ParserCombinators/Pandoc.hs
+++ b/src/Text/ParserCombinators/Pandoc.hs
@@ -46,7 +46,8 @@ import Data.Char ( toUpper, toLower )
--- | Parse any line of text
anyLine :: GenParser Char st [Char]
-anyLine = manyTill anyChar (newline <|> (do{eof; return '\n'}))
+anyLine = try (manyTill anyChar newline) <|> many1 anyChar
+ -- second alternative is for a line ending with eof
-- | Parses a space or tab.
spaceChar :: CharParser st Char