Skip to content

7.0.0 broke comments on nested elements #164

Closed
@pgorny

Description

@pgorny

The change in #163 naively that was included in 7.0.0 expects the node contents to be something that can be included in a regex, but the problem is that both CSS and Regex share some syntax elements, including [] used for attribute selector and character classes, respectively.

This means that a simple code like this:

/* Comment */
&[data-roots-all] {
  display: none;
}

will now fail with

SyntaxError: Invalid regular expression: //* Comment */ *
*&[data-roots-all] {
   display: none;
}/: Range out of order in character class

This is due to the fact that [data-roots-all] is not treated as a literal, but rather a character class - and thus s-a class trips it up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions