diff options
Diffstat (limited to 'src/Haddock')
-rw-r--r-- | src/Haddock/Backends/Xhtml.hs | 10 |
1 files changed, 7 insertions, 3 deletions
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 ( + "//<![CDATA[\nwindow.onload = function () {setSynopsis(\"mini_" + ++ moduleHtmlFile mdl ++ "\")};\n//]]>\n") + ) ) +++ body << ( pageHeader mdl_str iface doctitle |