Support » Plugin: W3 Total Cache » Option for disabling Double Quote Removal in HTML minify settings

  • Resolved danmuc

    (@danmuc)


    Please provide an option which allows me to disable to double quote removal from html source code when HTML minify is enabled.

    There are many people complaining about this new feature. You are referring to some guidelins where it’s written that attributes doesn’t need double quotes.

    But we have many problems with it. Even the url inspector within Google search console often fails to load our website when the quotes are removed.

    So as a webmaster i want to decide which “optimization” is done on my website. So please provide this option in next update or disable removeAttributeQuotes functionality until this option is available.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello,

    We are considering this for future releases. In the meantime Try adding this:
    In wp-content/plugins/w3-total-cache/lib/Minify/Minify/HTML.php replace lines 346 and 347 with
    $m[2] = preg_replace( '/([a-z0-9]=)\'([^"\'\\s=]+[^"\'\\s=\\/])\'(\\s(?!\\/)|>)/i', '$1$2$3', $m[2] );

    $m[2] = preg_replace( '/([a-z0-9]=)"([^"\'\\s=]+[^"\'\\s=\\/])"(\\s(?!\\/)|>)/i', '$1$2$3', $m[2] );

    I hope this helps.

    Hey Marco! Tks your answer. Unfortunatly this solutions doesn’t works for me. Instead, I commented all lines, keep only return uncommented and works. This options is really important, because with ‘link preload’, we got an error without quotes, see:

    With quotes:
    <link rel='preload' id='product-category-style-css' href='http://mysite.localhost/site/wp-content/themes/my-theme/dist/css/my-css.min.css' type='text/css' as='style' onload=this.onload=null;this.rel='stylesheet' media='all' />

    Without quotes:
    <link rel=preload id=product-category-style-css href=http://mysite.localhost/site/wp-content/themes/my-theme/dist/css/my-css.min.css type=text/css as=style onload=this.onload=null;this.rel=stylesheet media=all />

    Without quotes we got an error in this.rel=stylesheet : stylesheet is not defined and break all JS in the site.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.