Node.js version
v20.19.2
jsdom version
27.2.0
Minimal reproduction case
const { JSDOM } = require("jsdom");
const options = {};
const dom = new JSDOM(`
<style>
.visible\! {
color: red;
}
</style>
`, options);
How does similar code behave in browsers?
This works and is correctly parsed by browsers. According to the CSS grammar it is also allowed. This kind of syntax is used by tailwind.
What is the problem?
I expect this output to parse the classname as "visible!". However, the console prints Could not parse CSS stylesheet (the real error is hidden, but states that the class name is not valid).
This is an issue in the regex parsing class names in CSSOM.
Node.js version
v20.19.2
jsdom version
27.2.0
Minimal reproduction case
How does similar code behave in browsers?
This works and is correctly parsed by browsers. According to the CSS grammar it is also allowed. This kind of syntax is used by tailwind.
What is the problem?
I expect this output to parse the classname as "visible!". However, the console prints
Could not parse CSS stylesheet(the real error is hidden, but states that the class name is not valid).This is an issue in the regex parsing class names in CSSOM.