diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-10-29 21:00:48 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-10-29 21:00:48 +0000 |
commit | d5adbcb7746331d57c914d507286d50f86db0365 (patch) | |
tree | bf5d5cc987b33033a02cf1217b19c2222b243d59 /src/Text/Pandoc/Readers/Markdown.hs | |
parent | 63dfc3abf274bc4fb85b43c1e1a74e9baf18bc77 (diff) | |
download | pandoc-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/Readers/Markdown.hs')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index ce8a4b8eb..df84c0ac7 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -142,14 +142,16 @@ parseMarkdown = do startPos <- getPosition -- go through once just to get list of reference keys -- docMinusKeys is the raw document with blanks where the keys were... - docMinusKeys <- many (referenceKey <|> lineClump) >>= return . concat + docMinusKeys <- manyTill (referenceKey <|> lineClump) eof >>= + return . concat setInput docMinusKeys setPosition startPos st <- getState -- go through again for notes unless strict... if stateStrict st then return () - else do docMinusNotes <- many (noteBlock <|> lineClump) >>= return . concat + else do docMinusNotes <- manyTill (noteBlock <|> lineClump) eof >>= + return . concat st <- getState let reversedNotes = stateNotes st updateState $ \st -> st { stateNotes = reverse reversedNotes } |