diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 4c82f2c85..fe6ee5db4 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -142,7 +142,8 @@ pandocToHtml opts (Pandoc (Meta title' authors' date') blocks) = do
                            _ -> case lookup "mathml-script" (writerVariables opts) of
                                       Just s ->
                                         script ! [thetype "text/javascript"] <<
-                                           primHtml s
+                                           primHtml ("/*<![CDATA[*/\n" ++ s ++
+                                                     "/*]]>*/\n")
                                       Nothing -> noHtml
                 else noHtml
   let newvars = [("highlighting-css", defaultHighlightingCss) |
diff --git a/templates b/templates
index 8cb5fef74..8cd8b1959 160000
--- a/templates
+++ b/templates
@@ -1 +1 @@
-Subproject commit 8cb5fef740725ee51ffed5022faa097f21336bcd
+Subproject commit 8cd8b19598fa898498a7883d081f51615aa5fc12