diff options
author | Mark Lentczner <markl@glyphic.com> | 2010-04-25 06:26:10 +0000 |
---|---|---|
committer | Mark Lentczner <markl@glyphic.com> | 2010-04-25 06:26:10 +0000 |
commit | 5b7629a9e44276a0dca8e872b549c235c1101c3e (patch) | |
tree | 8c0f303aa8a40f8b990ea84026cb13848d3fb0c8 | |
parent | a70355a145e182bd1963ab707472dffb75f663bb (diff) |
fixed javascript quoting/escpaing issue
-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 |