• Resolved skunkworks

    (@skunkworks)


    Currently when enabling the minimize js and html option, inline comments i.e. “//hello” do not get stripped and so any code after the inline comment gets commented out as well.
    This is currently causing a problem with wp_customize_support_script() which adds this script to the page:
    <script type=”text/javascript”>
    (function() {
    var request, b = document.body, c = ‘className’, cs = ‘customize-support’, rcs = new RegExp(‘(^|\\s+)(no-)?’+cs+'(\\s+|$)’);
    request = true;
    b[c] = b[c].replace( rcs, ‘ ‘ );
    // The customizer requires postMessage and CORS (if the site is cross domain)
    b[c] += ( window.postMessage && request ? ‘ ‘ : ‘ no-‘ ) + cs;
    }());
    </script>

    As you can see in the above code when minified to one line,
    “b[c] += ( window.postMessage && request ? ‘ ‘ : ‘ no-‘ ) + cs;
    }());”
    gets commented out

    • This topic was modified 7 years, 1 month ago by skunkworks.
    • This topic was modified 7 years, 1 month ago by skunkworks.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Minimize Javascript/HTML Problem’ is closed to new replies.