@@ -423,8 +423,6 @@ imageTypeOf x = case drop 1 (map toLower (takeExtension x)) of
423423
424424data IdentState = IdentState{
425425 chapterNumber :: Int,
426− runningIdents :: [String],
427− chapterIdents :: [String],
428426 identTable :: [(String,String)]
429427 } deriving (Read, Show)
430428
@@ -453,23 +451,17 @@ correlateRefs :: Int -> [Block] -> [(String,String)]
453451correlateRefs chapterHeaderLevel bs =
454452 identTable $ execState (mapM_ go bs)
455453 IdentState{ chapterNumber = 0
456− , runningIdents = []
457− , chapterIdents = []
458454 , identTable = [] }
459455 where go :: Block -> State IdentState ()
460− go (Header n (ident,_,_) ils) = do
456+ go (Header n (ident,_,_) _) = do
461457 when (n <= chapterHeaderLevel) $
462− modify $ \s -> s{ chapterNumber = chapterNumber s + 1
463− , chapterIdents = [] }
458+ modify $ \s -> s{ chapterNumber = chapterNumber s + 1 }
464459 st <- get
465460 let chapterid = showChapter (chapterNumber st) ++
466461 if n <= chapterHeaderLevel
467462 then ""
468− else '#' : uniqueIdent ils (chapterIdents st)
469− modify $ \s -> s{ runningIdents = ident : runningIdents st
470− , chapterIdents = chapterid : chapterIdents st
471− , identTable = (ident, chapterid) : identTable st
472− }
463+ else '#' : ident
464+ modify $ \s -> s{ identTable = (ident, chapterid) : identTable st }
473465 go _ = return ()
474466
475467-- Replace internal link references using the table produced