What is minification doing to my HTML?

Netlify’s minification is doing quite a number on some embedded quotes. Check out below from my front page (www.geocene.com).

Here is the code as shown on github.
<!-- option 1, single quote on the HTML, double quote on the javascript, works --> <a href="/projects.html?tech-category=hardware" class="tech-list" onmouseover='colorIcons(true,"hardware")' onmouseleave='colorIcons(false,"hardware")'>...</a> ... <!-- option 2 double quote on HTML, single quote on javascript, doesn't work -- <a href="/projects.html?tech-category=data-science" class="tech-list" onmouseover="colorIcons(true,'data-science')" onmouseleave="colorIcons(false,'data-science')">...</a </div>

Here is what Netlify did to it with magnification/pretty links turned on:
<!-- option 1, single quote on the HTML, double quote on the javascript, leaves it, works --> <a href='/projects?tech-category=hardware' class='tech-list' onmouseover='colorIcons(true,"hardware")' onmouseleave='colorIcons(false,"hardware")'>...</a <!-- option 2, double quote on the HTML, single quote on the javascript, converts to escaped single quotes, doesn't work --> <a href='/projects?tech-category=backend' class='tech-list' onmouseover='colorIcons(true,\'backend\')' onmouseleave='colorIcons(false,\'backend\')'>...</a>

What is with option 2? There is a functional workaround here, but no clear reason for ’ " " ’ to work but for " ’ ’ " to fail.

Hi Dean,

Sorry to hear about the trouble!

Our asset optimization can definitely break CSS/JS in some corner cases. Definitely recommend not using it in your case if it does that, as I don’t see any work in our pipeline for that service in the immediate future.

I can’t see exactly your use cases/options in this post - some links didn’t come through I think? - so if you wanted to give me a better example I’ll either get a new bug filed or add your contact info to an existing one so I can let you know in the future in case we do get a fix eventually.

Wish I had better news for you today!

1 Like

Thank Fool, that’s what I expected. I edited the code to include some preformatter ticks.