minify
minify copied to clipboard
Why does jsMinifier ignore type attribute for SCRIPT tags?
I can see in the comments of Minify_HTML that when a jsMinifier callback is specified, the type attribute for SCRIPT tags is ignored. Why not err on the side of caution, and ONLY run the callback for when type="text/javascript"?
I'm trying to hook up Minify's HTML minification to an application that sometimes uses a javascript templating engine (like mustache), so it has SCRIPT tags that contain HTML content - which causes JSMin to throw an uncaught exception.
Since all sorts of content might appear within a SCRIPT tag, at least if type="text/javascript" one could be reasonably assured that in fact it does only contain Javascript.
Cheers, John
Great idea. Minify if type missing or one of these: http://tools.ietf.org/html/draft-hoehrmann-script-types-03#section-7
Any update on this?
I won't be able to get to this anytime soon.