Subject: Re: bug#61472: 29.0.60; css{-ts}-mode highlight problem

From: Dmitry Gutov <[email-masked]>
Date: Tue, 14 Feb 2023 03:26:04 +0200

On 13/02/2023 11:10, 牟 桐 wrote:
> When I'm checking the [offical
> doc](https://www.w3.org/TR/CSS21/syndata.html#characters), I saw that
> 
>> In CSS, identifiers can contain only the characters [a-zA-Z0-9] and
>> ISO 10646 characters U+00A0 and higher, plus the hyphen (-) and the
>> underscore (_)
> I don't know whether the major mode is designed to work like this (since
> the official said the `.` `#` ... are invalid, perhaps the browser made
> them work) or is the major mode's bug.
> 
> Thanks 😉

The parser indeed doesn't seem to be able to parse that text. I'm not 
sure whether it's an unofficial extension, or it's simply not expected 
to work in CSS files.

If it's the former, and the browsers support it, filing an issue at the 
grammar repo could help: 
https://github.com/tree-sitter/tree-sitter-css/issues

If it's the latter, here's some advice at the end of this answer: 
https://stackoverflow.com/a/32273294/615245 (to use ~=).