proper html script tag: source code must not be escaped;
authorFabian Huch <huch@in.tum.de>
Tue, 28 May 2024 19:51:49 +0200
changeset 80203 ca9a402735b4
parent 80202 03c058592c58
child 80204 81f2fbf3975d
proper html script tag: source code must not be escaped;
src/Pure/General/html.scala
--- a/src/Pure/General/html.scala	Tue May 28 19:51:09 2024 +0200
+++ b/src/Pure/General/html.scala	Tue May 28 19:51:49 2024 +0200
@@ -93,7 +93,7 @@
     XML.Elem(Markup("link", List("rel" -> "stylesheet", "type" -> "text/css", "href" -> href)), Nil)
   def style_file(path: Path): XML.Elem = style_file(Url.print_file(path.file))
 
-  def script(s: String): XML.Elem = XML.elem("script", text(s))
+  def script(s: String): XML.Elem = XML.elem("script", List(raw(text(s))))
   def script_file(href: String): XML.Elem = XML.Elem(Markup("script", List("src" -> href)), Nil)
   def script_file(path: Path): XML.Elem = script_file(Url.print_file(path.file))