minify icon indicating copy to clipboard operation
minify copied to clipboard

Why does jsMinifier ignore type attribute for SCRIPT tags?

Open johndwells opened this issue 12 years ago • 3 comments

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

johndwells avatar Nov 01 '12 19:11 johndwells

Great idea. Minify if type missing or one of these: http://tools.ietf.org/html/draft-hoehrmann-script-types-03#section-7

mrclay avatar Nov 23 '12 23:11 mrclay

Any update on this?

ukch avatar May 08 '15 09:05 ukch

I won't be able to get to this anytime soon.

mrclay avatar May 08 '15 10:05 mrclay