Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing javascript conditions due to compression #13

Open
grommas opened this issue Jun 5, 2018 · 1 comment
Open

Missing javascript conditions due to compression #13

grommas opened this issue Jun 5, 2018 · 1 comment

Comments

@grommas
Copy link

grommas commented Jun 5, 2018

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

@jenstornell
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants