aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Shared.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-10-29 21:00:48 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-10-29 21:00:48 +0000
commitd5adbcb7746331d57c914d507286d50f86db0365 (patch)
treebf5d5cc987b33033a02cf1217b19c2222b243d59 /src/Text/Pandoc/Shared.hs
parent63dfc3abf274bc4fb85b43c1e1a74e9baf18bc77 (diff)
downloadpandoc-d5adbcb7746331d57c914d507286d50f86db0365.tar.gz
Fixed bug in parsing files that begin with blank lines.
+ In Text.Pandoc.Shared: rewrote lineClump to parse EITHER a string of blank lines OR a string of nonblanks. Removed code for parsing eof. + In Markdown and RST readers, use 'manyTill (... <|> lineClump) eof' instead of many, since lineClump no longer parses eof. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1057 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Shared.hs')
-rw-r--r--src/Text/Pandoc/Shared.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 593311b01..f27c3ae75 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -298,10 +298,8 @@ parseFromString parser str = do
-- | Parse raw line block up to and including blank lines.
lineClump :: GenParser Char st String
-lineClump = do
- lns <- many1 (notFollowedBy blankline >> anyLine)
- blanks <- blanklines <|> (eof >> return "\n")
- return $ (unlines lns) ++ blanks
+lineClump = blanklines
+ <|> (many1 (notFollowedBy blankline >> anyLine) >>= return . unlines)
-- | Parse a string of characters between an open character
-- and a close character, including text between balanced