diff options
author | Mark Lentczner <markl@glyphic.com> | 2010-07-19 05:20:53 +0000 |
---|---|---|
committer | Mark Lentczner <markl@glyphic.com> | 2010-07-19 05:20:53 +0000 |
commit | d3ebf5f25ead73877b38302cbe8b1ed13e993917 (patch) | |
tree | c185060caab9a83c4fc0d41324bb90f26a7907b0 /src/Haddock/Backends/Xhtml/Util.hs | |
parent | a7aad74a978e2e1d313c23863c7a91983bbc4848 (diff) |
refactoring of anchor ID and fragment handling
Diffstat (limited to 'src/Haddock/Backends/Xhtml/Util.hs')
-rw-r--r-- | src/Haddock/Backends/Xhtml/Util.hs | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/Haddock/Backends/Xhtml/Util.hs b/src/Haddock/Backends/Xhtml/Util.hs index 1fcf5e94..20b246d1 100644 --- a/src/Haddock/Backends/Xhtml/Util.hs +++ b/src/Haddock/Backends/Xhtml/Util.hs @@ -157,21 +157,11 @@ dot = toHtml "." -- | Generate a named anchor --- --- This used to generate two anchor tags, one with the name unescaped, and one --- with the name URI-escaped. This is needed because Opera 9.52 (and later --- versions) needs the name to be unescaped, while IE 7 needs it to be escaped. --- The escaped form for IE 7 is probably erroneous and not needed... - namedAnchor :: String -> Html -> Html -namedAnchor n c = anchor ! [XHtml.name n] << c +namedAnchor n = anchor ! [XHtml.name n] linkedAnchor :: String -> Html -> Html -linkedAnchor frag = anchor ! [href hr_] - where hr_ | null frag = "" - | otherwise = '#': escapeStr frag - -- this escape function is over-zealous for the fragment part of a URI - -- (':' for example does not need to be escaped) +linkedAnchor n = anchor ! [href ('#':n)] -- -- A section of HTML which is collapsible via a +/- button. |