Possible bug on complex CSS selector?

For technical support and bug reports for all editions of CSS HTML Validator, including htmlval for Linux and Mac.
TomHTML
Rank III - Intermediate
Posts: 75
Joined: Sun Feb 04, 2018 10:19 am

Possible bug on complex CSS selector?

Post by TomHTML »

The validator complains that this CSS selector is invalid, yet the W3 HTML and CSS checkers approve it (and it works for styling my elements):

Code: Select all

.block .block-content a[href*="//"][target*="_blank"]:not(.image-overlay):not([href*="example.com"])::after
It complains about *="example.com", stating:
There should be a valid attribute selector ([att=value]), class selector (.class), ID selector (#id), or psuedo-class (:class) here.
But this is what I need, and it does work: I'm excluding elements with an href containing "example.com" anywhere in the href string. Is there a preferred way to do this that is different than this formulation, or is this a bug? (I have version 18.0300).

Many thanks,
Tom
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: Possible bug on complex CSS selector?

Post by Albert Wiersch »

Hi Tom,

Yes, sorry. It is a bug. I first discovered it while developing CSS HTML Validator 2019. I've back-ported a fix to the current download of CSS HTML Validator Standard 2018.

If you download CSS HTML Validator Standard 2018 then you should get v18.0331 or above. The system's update check won't detect this update yet but you should get the update if you download it here:
https://www.htmlvalidator.com/download/ ... ionin=1801

Please let me know if that fixes the problem.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
TomHTML
Rank III - Intermediate
Posts: 75
Joined: Sun Feb 04, 2018 10:19 am

Re: Possible bug on complex CSS selector?

Post by TomHTML »

Thanks! I've installed and run it, and the bug seems to be patched! Many thanks!
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: Possible bug on complex CSS selector?

Post by Albert Wiersch »

Great! And you're very welcome!
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial