aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-02-15 01:33:35 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-02-15 01:33:35 +0000
commit9ad7c73b577fa2286084c559f5dba670f93ae24e (patch)
tree7a48551874e5d7dd921edc66c643d10a185c7a05 /src/Text/Pandoc/Readers
parentd3efa4aa8a7a051c87734be3f923490913d3f2d9 (diff)
downloadpandoc-9ad7c73b577fa2286084c559f5dba670f93ae24e.tar.gz
Use lookAhead instead of getInput/setInput in RST reader.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@537 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/RST.hs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index 70d55476e..876a7ef75 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -101,13 +101,11 @@ titleTransform blocks = (blocks, [])
parseRST = do
state <- getState
- input <- getInput
-- first pass: get anonymous keys
- keyBlocks <- manyTill (anonymousKey <|> (do{anyLine; return Null})) eof
+ keyBlocks <- lookAhead $ manyTill (anonymousKey <|> (do{anyLine; return Null})) eof
let anonymousKeys = filter (/= Null) keyBlocks
-- run parser again to fill in anonymous links...
setState (state { stateKeyBlocks = anonymousKeys })
- setInput input
blocks <- parseBlocks
let blocks' = filter isNotAnonKeyBlock blocks
let (blocks'', title) = if stateStandalone state