Title: Inline JS minification &#8211; single line comments breaking script
Last modified: April 8, 2020

---

# Inline JS minification – single line comments breaking script

 *  Resolved Anonymous User 13936399
 * (@anonymized-13936399)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/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.

 * ![](https://ps.w.org/cache-enabler/assets/icon.svg?rev=2442383)
 * [Cache Enabler](https://wordpress.org/plugins/cache-enabler/)
 * [Support Threads](https://wordpress.org/support/plugin/cache-enabler/)
 * [Active Topics](https://wordpress.org/support/plugin/cache-enabler/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cache-enabler/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cache-enabler/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: Anonymous User 13936399
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/inline-js-minification-single-line-comments-breaking-script/)
 * Status: resolved