• The following code is from a theme I bought, which has a wrong html comment of the type <– –> inside a tag script:

    <script>
    <!–pass images–>
    var theme_directory = “”;
    …rest of code
    </script>

    chrome ignores this comment and does not report it as an error.

    but when autoptimize removes the HTML comments within the <script></script> tags, the following error is generated:

    Uncaught SyntaxError: Unexpected identifier
    <script>
    pass images–>
    var theme_directory = “”;
    …rest of code
    </script>

    Is it correct, that autooptimize within the scope of a script removes code independent of whether it is badly coded? should not leave intact the code that goes inside the tag <script></script>, because that code is interpreted by the JS engine and not by the explorer’s graphic part.

    Thank you.

Viewing 1 replies (of 1 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    It’s a known issue, afraid you’ll have to either remove the comment from the theme’s JS or tick the “keep HTML comments” option for now.

Viewing 1 replies (of 1 total)
  • The topic ‘HTML comments inside script problem’ is closed to new replies.