One idea for the JavaScript issues:
Before applying the compression replace all instances of <script> ... </script> with $script[x].
Afterwards run a special compression on the script-snippets (which should just ignore <!-- and -->, or maybe strip them but not the text within), then run the compression on the template (as there are no <!-- or // within JavaScripts now there should be no problems) and finally re-substitue the $script[x] with the script(s).
|