• Resolved snippet24

    (@snippet24)


    Hi, I have some code examples which shouldn’t be minified, but still would like to minify everything else, is there some way to exclude them that I may have overlooked? I’m using prism.js for this code examples..

    Regards

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

    (@optimizingmatters)

    afraid not, the only thing you could do is use the autoptimize_html_minify_inline_js_css filter to disable that option on specific pages?

    Thread Starter snippet24

    (@snippet24)

    Oh I see, problem is that page has inline code that should be minified, unless maybe I convert all inline scrips into separated js files, and then disabling it in the page could be the closest solution I guess.. Most likely not possible to exclude an html tag or script type, but I that would be ideal perhaps. Example of prism snippet for reference:

    <pre class="line-numbers"><code class="language-html">            <script type="prism-html-markup">
    /* code that shouldnt be minified */</script>                </code></pre>
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    afraid that CSS/ JS minification is done as part of HTML minification and the exclusions don’t work there, so it’s all or nothing really .. :-/

    Thread Starter snippet24

    (@snippet24)

    Understood, thank you as usual Frank 🙂

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

The topic ‘How to exclude inline script from “Also minify inline JS/ CSS?”’ is closed to new replies.