feature-request: css attribute selectors
Maybe anyone can create a pull request for css attribute selectors or has a solution? http://www.w3schools.com/css/css_attribute_selectors.asp
htmlpurifier remove attributes in css. I need this two variants: [attribute] and [attribute="value"]
This is using CSSTidy? I don't think you can do attribute selectors in inline CSS.
I don't need it for inline CSS. :)
You need it for two cases. A html-file with <style> in it or to check a css-file. I use both.
I'm running into this exact situation. Using HTMLPurifier & CSSTidy — the output is stripping rules like .fonts-stage-2 [aria-label][data-balloon-pos]:after{color:#fff;}
I'm using the latest versions of both utilities.
Big Q here is whether or not CSSTidy understands attribute selectors. If it does, it's probably just a matter of tweaking HTML Purifier code to stop stripping them out. If it doesn't, that's going to be more work, and an update to CSSTidy
AFAIK, CSSTidy does understand attribute selectors. See this issue. https://github.com/Cerdic/CSSTidy/issues/47
Thanks,
— CZ
On 27Feb 2021, at 7:40 PM, Edward Z. Yang [email protected] wrote:
Big Q here is whether or not CSSTidy understands attribute selectors. If it does, it's probably just a matter of tweaking HTML Purifier code to stop stripping them out. If it doesn't, that's going to be more work, and an update to CSSTidy
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ezyang/htmlpurifier/issues/69#issuecomment-787217375, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACGIXEOREOZ6KZGKVFMQLDTBGNJVANCNFSM4BX6IK6Q.
OK, so someone just has to go to library/HTMLPurifier/Filter/ExtractStyleBlocks.php and extend the selector processing code to add attribute selectors (and make sure you don't introduce any security vulnerabilities in the process)