diff options
author | Alec Theriault <alec.theriault@gmail.com> | 2020-03-28 14:12:48 -0400 |
---|---|---|
committer | Alec Theriault <alec.theriault@gmail.com> | 2020-03-28 14:26:27 -0400 |
commit | 5dc3866928759fcaf6b31d1598051781389a01d4 (patch) | |
tree | 4c7745419ef14f384a2688d96f960721f48652f1 /haddock-api/src/Haddock/Backends | |
parent | d8bedeb98a84db0d51c49d41c632d9d4846d1bbe (diff) |
Disallow links in section headers
This is quite straightforward to implement, since we already had a
function `docToHtmlNoAnchors` (which we used to generate the link in the
sidebar "Contents").
This breaks test `Bug387`, but that test case has aged badly: we now
automatically generate anchors for all headings, so manually adding an
anchor in a section makes no sense. Nested anchors are, as pointed out
in #1054, disallowed by the HTML standard.
Fixes #1054
Diffstat (limited to 'haddock-api/src/Haddock/Backends')
-rw-r--r-- | haddock-api/src/Haddock/Backends/Xhtml.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs index d30312b7..e3d4e8ca 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml.hs @@ -681,7 +681,7 @@ processExport :: Bool -> LinksInfo -> Bool -> Maybe Package -> Qualification -> ExportItem DocNameI -> Maybe Html processExport _ _ _ _ _ ExportDecl { expItemDecl = L _ (InstD {}) } = Nothing -- Hide empty instances processExport summary _ _ pkg qual (ExportGroup lev id0 doc) - = nothingIf summary $ groupHeading lev id0 << docToHtml (Just id0) pkg qual (mkMeta doc) + = nothingIf summary $ groupHeading lev id0 << docToHtmlNoAnchors (Just id0) pkg qual (mkMeta doc) processExport summary links unicode pkg qual (ExportDecl decl pats doc subdocs insts fixities splice) = processDecl summary $ ppDecl summary links decl pats doc insts fixities subdocs splice unicode pkg qual processExport summary _ _ _ qual (ExportNoDecl y []) |