kirby-html-minifier
kirby-html-minifier copied to clipboard
Missing javascript conditions due to compression
I have a (pre-)compressed script in my header. When using your plugin, it deletes one of two conditions.
original:
<script>!function(s,t){var e=document.documentElement,n=(new Date).getHours();e.classList.remove("no-js"),n>20||n<8?e.classList.add("day"):e.classList.add("night")}(window,document);</script>
compressed:
<script>!function(s,t){var e=document.documentElement,n=(new Date).getHours();e.classList.remove("no-js"),n<8?e.classList.add("day"):e.classList.add("night")}(window,document);</script>
I was wondering why? Thanks in advance! Cheers, Jakob
It's because you have <
and >
in your inline script. I will try to find a fix but I can't say when. In the meantime, maybe you can move the inline js into your a js file?