From 0183315fa02a5fd2046103a4f0d431fb033547a4 Mon Sep 17 00:00:00 2001 From: David Waern Date: Sun, 23 Nov 2008 17:13:21 +0000 Subject: 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. --- src/Haddock/Backends/Html.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/Haddock') 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. -- cgit v1.2.3