diff options
author | Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk> | 2014-02-24 06:07:33 +0000 |
---|---|---|
committer | Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk> | 2014-02-24 06:09:54 +0000 |
commit | 1bf686940b28394f5d169f297659cd4c66869ec1 (patch) | |
tree | d2107dc6b2a4efd5d482ea11a02faceb31e0f8ac /src/Haddock/Backends/Xhtml.hs | |
parent | 6ca276702d04c9183caa98d1848f6aa5b88a8755 (diff) |
Fix rendering of Contents when links are present
Fixes Haddock Trac #267.
Diffstat (limited to 'src/Haddock/Backends/Xhtml.hs')
-rw-r--r-- | src/Haddock/Backends/Xhtml.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Haddock/Backends/Xhtml.hs b/src/Haddock/Backends/Xhtml.hs index 35b82a2c..bdd1afdc 100644 --- a/src/Haddock/Backends/Xhtml.hs +++ b/src/Haddock/Backends/Xhtml.hs @@ -625,7 +625,8 @@ ppModuleContents qual exports | lev <= n = ( [], items ) | otherwise = ( html:secs, rest2 ) where - html = linkedAnchor (groupId id0) << docToHtml qual doc +++ mk_subsections ssecs + html = linkedAnchor (groupId id0) + << docToHtmlNoAnchors qual doc +++ mk_subsections ssecs (ssecs, rest1) = process lev rest (secs, rest2) = process n rest1 process n (_ : rest) = process n rest @@ -633,7 +634,6 @@ ppModuleContents qual exports mk_subsections [] = noHtml mk_subsections ss = unordList ss - -- we need to assign a unique id to each section heading so we can hyperlink -- them from the contents: numberSectionHeadings :: [ExportItem DocName] -> [ExportItem DocName] @@ -654,10 +654,11 @@ processExport summary _ _ qual (ExportGroup lev id0 doc) processExport summary links unicode qual (ExportDecl decl doc subdocs insts) = processDecl summary $ ppDecl summary links decl doc insts subdocs unicode qual processExport summary _ _ qual (ExportNoDecl y []) - = processDeclOneLiner summary $ ppDocName qual Prefix y + = processDeclOneLiner summary $ ppDocName qual Prefix True y processExport summary _ _ qual (ExportNoDecl y subs) = processDeclOneLiner summary $ - ppDocName qual Prefix y +++ parenList (map (ppDocName qual Prefix) subs) + ppDocName qual Prefix True y + +++ parenList (map (ppDocName qual Prefix True) subs) processExport summary _ _ qual (ExportDoc doc) = nothingIf summary $ docSection_ qual doc processExport summary _ _ _ (ExportModule mdl) |