From 46dec6c5afd0273a03ca7526c4b6af8f1fbaca26 Mon Sep 17 00:00:00 2001 From: panne Date: Tue, 13 Jul 2004 17:59:28 +0000 Subject: [haddock @ 2004-07-13 17:59:28 by panne] A quote is a valid part of a Haskell identifier, but it would interfere with an ECMA script string delimiter, so escape it there. --- src/HaddockHtml.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/HaddockHtml.hs b/src/HaddockHtml.hs index a52e831b..1909805a 100644 --- a/src/HaddockHtml.hs +++ b/src/HaddockHtml.hs @@ -583,7 +583,7 @@ ppHsDataDecl summary instances is_newty aboves (map ppSideBySideConstr cons) ) - inst_id = "i:" ++ hsNameStr nm + inst_id = collapseId nm instances_bit | null instances = Html.emptyTable @@ -762,7 +762,7 @@ ppHsClassDecl summary instances orig_c ] ) - inst_id = "i:" ++ hsNameStr nm + inst_id = collapseId nm instances_bit | null instances = Html.emptyTable | otherwise @@ -1126,3 +1126,8 @@ collapsebutton id = collapsed :: String -> Html -> Html collapsed id html = thediv ! [identifier id, thestyle "display:none;"] << html + +-- A quote is a valid part of a Haskell identifier, but it would interfere with +-- the ECMA script string delimiter used in collapsebutton above. +collapseId :: HsName -> String +collapseId nm = "i:" ++ escapeString (hsNameStr nm) (/= '\'') -- cgit v1.2.3