aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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