@@ -170,12 +170,11 @@ parseMarkdown = do
170170 updateState (\state -> state { stateParseRaw = True })
171171 -- need to parse raw HTML, since markdown allows it
172172 (title, author, date) <- option ([],[],"") titleBlock
173− oldState <- getState
174173 -- go through once just to get list of reference keys
175174 keysUsed <- lookAhead $ (do {manyTill (referenceKey <|> (do{anyLine; return Null})) eof;
176175 newState <- getState;
177176 return $ stateKeysUsed newState})
178− setState (oldState { stateKeysUsed = keysUsed })
177+ updateState (\st -> st { stateKeysUsed = keysUsed })
179178 blocks <- parseBlocks -- go through again, for real
180179 let blocks' = filter (/= Null) blocks
181180 state <- getState