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
385 stars 32 forks source link

Multiple ignored CSS blocks #181

Open chrisstaite-menlo opened 3 months ago

chrisstaite-menlo commented 3 months ago

If there are multiple ignored CSS blocks within a single clean-css warning message, only the first is replaced with the ignore code. This means that some ingored blocks are simply deleted from the output.

The problem is simply that the RegExp is only applied once, despite having the global flag set on it. This is fixed by calling exec on the RegExp until it yields no further matches.

Added a test for this error case.

Fixes #180