ezyang / htmlpurifier

Standards compliant HTML filter written in PHP
http://htmlpurifier.org
GNU Lesser General Public License v2.1
3.02k stars 323 forks source link

CSS pseudo class "has()" not supported #397

Open PHPGangsta opened 4 months ago

PHPGangsta commented 4 months ago

Hi!

I have a case with this CSS in an email:

p:has(br:only-child) {
    margin: 0;
    display: none;
}

I'm using $config->set('Filter.ExtractStyleBlocks', true);

The result is:

p {
    margin: 0;
    display: none;
}

Looks like neither "has()" nor ":only-child" is supported? ":first-child" is supported as far as I saw.

Can I add those 2 missing CSS pseudo selectors/classes somehow via configuration?