GNU bug report logs - #61472
29.0.60; css{-ts}-mode highlight problem

Previous Next

Package: emacs;

Reported by: 牟 桐 <mou.tong <at> outlook.com>

Date: Mon, 13 Feb 2023 09:16:02 UTC

Severity: normal

Found in version 29.0.60

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: 牟 桐 <mou.tong <at> outlook.com>, 61472 <at> debbugs.gnu.org
Subject: bug#61472: 29.0.60; css{-ts}-mode highlight problem
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 ~=).




This bug report was last modified 2 years and 77 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.