diff options
Diffstat (limited to 'src/Haddock/Backends/Xhtml/Util.hs')
-rw-r--r-- | src/Haddock/Backends/Xhtml/Util.hs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/Haddock/Backends/Xhtml/Util.hs b/src/Haddock/Backends/Xhtml/Util.hs index 826b69f1..f2527b06 100644 --- a/src/Haddock/Backends/Xhtml/Util.hs +++ b/src/Haddock/Backends/Xhtml/Util.hs @@ -177,15 +177,21 @@ s8 = tda [ theclass "s8" ] << noHtml -- | Generate a named anchor -- --- This actually generates two anchor tags, one with the name unescaped, and one +-- 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. --- -namedAnchor :: String -> Html -> Html -namedAnchor n c = anchor ! [Html.name n] << noHtml +++ - anchor ! [Html.name (escapeStr n)] << c +-- The escaped form for IE 7 is probably erroneous and not needed... +namedAnchor :: String -> Html -> Html +namedAnchor n c = anchor ! [Html.name n] << c +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) + -- -- A section of HTML which is collapsible via a +/- button. -- @@ -207,11 +213,6 @@ collapsed fn id_ html = collapseId :: Name -> String collapseId nm = "i:" ++ escapeStr (getOccString nm) -linkedAnchor :: String -> Html -> Html -linkedAnchor frag = anchor ! [href hr_] - where hr_ | null frag = "" - | otherwise = '#': escapeStr frag - documentCharacterEncoding :: Html documentCharacterEncoding = meta ! [httpequiv "Content-Type", content "text/html; charset=UTF-8"] |