htmlcompressor icon indicating copy to clipboard operation
htmlcompressor copied to clipboard

Additional script types to be compressed as HTML

Open GoogleCodeExporter opened this issue 10 years ago • 2 comments

It seems that the script type 'x-jquery-tmpl' won't be used much in the future 
as jQuery tmpl plugin has been abandoned [1] some time ago. It would be good if 
'text/html' and 'text/template' were added to the script type check, as they 
are the two most commonly used alternative types for JS templates.

If you accept patches I'll be able to do this sometime this week.
Thank you.

[1] "The jQuery team has decided not to take this plugin past beta. It is no 
longer being actively developed or maintained." - http://api.jquery.com/tmpl/

Original issue reported on code.google.com by [email protected] on 20 May 2012 at 11:11

GoogleCodeExporter avatar Nov 27 '15 21:11 GoogleCodeExporter

Thanks for the report. No need to do the patch, I probably would need to 
introduce a new option to compress "text/" scripts as html.

Original comment by [email protected] on 20 May 2012 at 5:44

  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

GoogleCodeExporter avatar Nov 27 '15 21:11 GoogleCodeExporter

One solution, that would make it simple for common use cases, could be for that 
new option, say '--compress-script', to compress any script tag that has a type 
defined and that type is not any of 'text/javascript', 'text/ecmascript', 
'application/javascript', and 'application/ecmascript'. Other exceptions via 
the config file could be provided but I can't imagine that would be used too 
often.

Original comment by [email protected] on 21 May 2012 at 1:00

GoogleCodeExporter avatar Nov 27 '15 21:11 GoogleCodeExporter