diff options
author | David Waern <david.waern@gmail.com> | 2008-11-23 17:13:21 +0000 |
---|---|---|
committer | David Waern <david.waern@gmail.com> | 2008-11-23 17:13:21 +0000 |
commit | 0183315fa02a5fd2046103a4f0d431fb033547a4 (patch) | |
tree | 520bd89176b5d9ac7555137b4ee277aeca4891aa /src | |
parent | 9f5e97684ae513a7465a9a8a6ff962d45066d243 (diff) |
FIX #45: generate two anchors for each name
We generate two anchor tags for each name, one where we don't escape the name
and one where we URI-encode it. This is for compatibility between IE and Opera.
Test output is updated.
Diffstat (limited to 'src')
-rw-r--r-- | src/Haddock/Backends/Html.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Haddock/Backends/Html.hs b/src/Haddock/Backends/Html.hs index a89a9b20..b9922262 100644 --- a/src/Haddock/Backends/Html.hs +++ b/src/Haddock/Backends/Html.hs @@ -1806,8 +1806,16 @@ s8, s15 :: HtmlTable s8 = tda [ theclass "s8" ] << noHtml s15 = tda [ theclass "s15" ] << noHtml + +-- | Generate a named anchor +-- +-- This actually generates 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 = anchor ! [name (escapeStr n)] +namedAnchor n = (anchor ! [name n]) . (anchor ! [name (escapeStr n)]) + -- -- A section of HTML which is collapsible via a +/- button. |