Title: Inline Javascript Minifying doesn&#039;t remove some //comments
Last modified: August 31, 2016

---

# Inline Javascript Minifying doesn't remove some //comments

 *  [maercel](https://wordpress.org/support/users/maercel/)
 * (@maercel)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/inline-javascript-minifying-doesnt-remove-some-comments/)
 * Hi! I like the plugin, it’s simple and effective. Found a tiny problem: when 
   cache-minimizing is set to “HTML and inline JavaScript” it seems that some //
   comments are not being removed, resulting in a “unexpected end of script” error
   in safari debug console, and “expected: }” in chrome. The error disappears when
   it’s set to “HTML only”. Kind regards
 * [https://wordpress.org/plugins/cachify/](https://wordpress.org/plugins/cachify/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Pascal Birchler](https://wordpress.org/support/users/swissspidy/)
 * (@swissspidy)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/inline-javascript-minifying-doesnt-remove-some-comments/#post-7221768)
 * Hey there,
 * Thanks for your report! Is there any specific plugin or theme you’ve experienced
   this with so we can test this?
 * Cheers
 *  Thread Starter [maercel](https://wordpress.org/support/users/maercel/)
 * (@maercel)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/inline-javascript-minifying-doesnt-remove-some-comments/#post-7221770)
 * Hello, I made a test template with a single “index.php”, you can see it here:
   [http://stofflager.ch/test/](http://stofflager.ch/test/)
 * The source is:
 *     ```
       <!DOCTYPE html>
       <html><head><title>Test</title></head>
       <body>
       <h1>Cachify Test</h1>
       <script type="text/javascript">
       function test(){
       	// this is a comment
       }
       </script>
       </body>
       ```
   
 * Regards, Marc
 *  Thread Starter [maercel](https://wordpress.org/support/users/maercel/)
 * (@maercel)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/inline-javascript-minifying-doesnt-remove-some-comments/#post-7221801)
 * Hey, I’ve tried something on my own and it works for me, although is not 100%
   tested. The modified code starts at line 1264 in cachify.class.php, consists 
   of two nested rather complicated Regexes modified from web search results which
   maybe could be merged:
 * [http://pastebin.com/Dc1wzZVc](http://pastebin.com/Dc1wzZVc)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Inline Javascript Minifying doesn't remove some //comments’ is closed
to new replies.

 * ![](https://ps.w.org/cachify/assets/icon-256x256.png?rev=2505413)
 * [Cachify](https://wordpress.org/plugins/cachify/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cachify/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cachify/)
 * [Active Topics](https://wordpress.org/support/plugin/cachify/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cachify/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cachify/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [maercel](https://wordpress.org/support/users/maercel/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/inline-javascript-minifying-doesnt-remove-some-comments/#post-7221801)
 * Status: not resolved