Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[enhance] xhtml: do not generate script tag if empty inline script

  • Loading branch information...
commit b8f08373b91ea40278c8bbd3403d7218f706bb5b 1 parent ee22493
Frederic Ye Aqua-Ye authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 stdlib/core/xhtml/xhtml.opa
6 stdlib/core/xhtml/xhtml.opa
View
@@ -683,7 +683,7 @@ Xhtml =
@private sassoc_full(namespace, name, value) : Xml.attribute = ~{ namespace name value }
to_string = serialize_to_string
-
+
@private
JsEvent = {{
@@ -1101,7 +1101,9 @@ Xhtml =
* to be used with [prepare_for_xhtml_export]
*/
finalize_js_inline(js:xhtml):xhtml =
- {fragment = [of_string_unsafe(_script_start), js, of_string_unsafe(_script_end)]}
+ match compile(js)
+ {text=""} {content_unsafe=""} {fragment=[]} -> empty_xhtml
+ _ -> {fragment = [of_string_unsafe(_script_start), js, of_string_unsafe(_script_end)]}
/**
* Perform the final compilation of a html fragment.
Please sign in to comment.
Something went wrong with that request. Please try again.