terser / html-minifier-terser

actively maintained fork of html-minifier - minify HTML, CSS and JS code using terser - supports ES6 code
https://terser.org/html-minifier-terser
MIT License
376 stars 30 forks source link

Messes with cases when it shouldn't #57

Closed entozoon closed 3 years ago

entozoon commented 3 years ago

If you have some liquid statements like

{% if fooBar %} baz {% endif %}

For some reason it outputs foobar, removing the capital letter, even with the option caseSensitive: true.

A quick workaround is to add the rule:

ignoreCustomFragments: [
  /(?<={%)(.*?)(?=%})/, // {% this %} 
]

But it's not ideal of course, and the bug seemed a little unexpected.

PS: Love the plugin, fantastically useful!

entozoon commented 3 years ago

Oh, no. This was totally a lock problem on my end. My apologies. That workaround is still useful though for some situations though, I'm sure. Thanks