aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Backends/Xhtml/Utils.hs
diff options
context:
space:
mode:
authorMark Lentczner <markl@glyphic.com>2010-09-04 23:19:47 +0000
committerMark Lentczner <markl@glyphic.com>2010-09-04 23:19:47 +0000
commit376c911ff8aac92703fccb365d85799f806ab969 (patch)
treefed93b2ce7223431f242f5e620e00ec55a240054 /src/Haddock/Backends/Xhtml/Utils.hs
parent875d02440ea1e4f7e7b0a400151725f806b23122 (diff)
make TOC group header identifiers validate
Diffstat (limited to 'src/Haddock/Backends/Xhtml/Utils.hs')
-rw-r--r--src/Haddock/Backends/Xhtml/Utils.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Haddock/Backends/Xhtml/Utils.hs b/src/Haddock/Backends/Xhtml/Utils.hs
index 10f9e766..f0b6941c 100644
--- a/src/Haddock/Backends/Xhtml/Utils.hs
+++ b/src/Haddock/Backends/Xhtml/Utils.hs
@@ -15,6 +15,7 @@ module Haddock.Backends.Xhtml.Utils (
namedAnchor, linkedAnchor,
spliceURL,
+ groupId,
(<+>), char, nonEmpty,
keyword, punctuate,
@@ -172,6 +173,10 @@ linkedAnchor :: String -> Html -> Html
linkedAnchor n = anchor ! [href ('#':n)]
+-- | generate an anchor identifier for a group
+groupId :: String -> String
+groupId g = makeAnchorId ("g:" ++ g)
+
--
-- A section of HTML which is collapsible.
--