Inline JS minification – single line comments breaking script
-
When “HTML & Inline JS” minification is selected, inline scripts that contain a single line comment will break the script, i.e consider this:
<script> // Comment console.log('Hello'); </script>Will become this after minifying (the log won’t execute as everything gets commented out):
<script> // Comment console.log('Hello'); </script>Suggestion – parse inline JS and strip all comments, including single line and even multiline (even though the latter don’t cause an issue, comments are generally omitted during minification).
The topic ‘Inline JS minification – single line comments breaking script’ is closed to new replies.