aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/RST.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Readers/RST.hs')
-rw-r--r--src/Text/Pandoc/Readers/RST.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index 876a7ef75..b42deb44c 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -100,12 +100,12 @@ titleTransform ((Header 1 head1):rest) = -- title, no subtitle
titleTransform blocks = (blocks, [])
parseRST = do
- state <- getState
-- first pass: get anonymous keys
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 })
+ updateState (\st -> st { stateKeyBlocks = anonymousKeys })
+ state <- getState
blocks <- parseBlocks
let blocks' = filter isNotAnonKeyBlock blocks
let (blocks'', title) = if stateStandalone state