From 5b7629a9e44276a0dca8e872b549c235c1101c3e Mon Sep 17 00:00:00 2001 From: Mark Lentczner Date: Sun, 25 Apr 2010 06:26:10 +0000 Subject: fixed javascript quoting/escpaing issue --- src/Haddock/Backends/Xhtml.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/Haddock/Backends') diff --git a/src/Haddock/Backends/Xhtml.hs b/src/Haddock/Backends/Xhtml.hs index 01b4c861..6e6decf7 100644 --- a/src/Haddock/Backends/Xhtml.hs +++ b/src/Haddock/Backends/Xhtml.hs @@ -566,9 +566,13 @@ ppHtmlModule odir doctitle styleSheet +++ (script ! [src jsFile, thetype "text/javascript"] $ noHtml) +++ (script ! [thetype "text/javascript"] - -- XXX: quoting errors possible? - << ("window.onload = function () {setSynopsis(\"mini_" - ++ moduleHtmlFile mdl ++ "\")};")) + -- NB: Within XHTML, the content of script tags needs to be + -- a CDATA section. Will break if the generated name could + -- have "]]>" in it! + << primHtml ( + "//\n") + ) ) +++ body << ( pageHeader mdl_str iface doctitle -- cgit v1.2.3