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