FullHuman/purgecss-webpack-plugin

[src=''] becomes [src]

kurtextrem opened this issue · 2 comments

version: 1.3.1

Behavior:
The PurgeCSS plugin 'minifies' img[src=''] to img[src] for whatever reason. This breaks functionality, as the latter matches every img element with a src attribute. The first one only empty ones.

Expected:
img[src=''] stays the way it is.

However, this only happens, when the CSS is minified beforehand (with csso/clean-css/cssnano) (if I remove the minifier, this issue is gone, however if I only turn on the minifier without PurgeCSS, the issue is gone too - so PurgeCSS is faulty)

And this also happens if I wrap the css in /* purgecss start ignore */.