Skip to content

Commit aaf24dc

Browse files
committed
Fix parsing <*-in-parens>
Oversight. `selector(:not)` was falling back to `<general-enclosed>` but not `selector(:not) and (color: green)`, for example, because `<general-enclosed>` was not parsed with the `lazy` parameter.
1 parent 480ad40 commit aaf24dc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/parse/intercept.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
/**
33
* @param {SyntaxError} error
44
* @param {object} node
5-
* @param {object} parser
65
* @returns {SyntaxError|object[]}
76
*
87
* It stops propagating an error resulting from parsing an item of a forgiving
98
* selector list, to serialize the list with the invalid selector.
109
*/
11-
function interceptInvalidSelector(error, { context, input, location }, parser) {
10+
function interceptInvalidSelector(error, { context, input }) {
1211
if (!context.strict && context.forgiving) {
1312
input.moveToEnd()
1413
return input.data
@@ -27,7 +26,7 @@ function interceptInvalidSelector(error, { context, input, location }, parser) {
2726
*/
2827
function interceptQueryInParensError(error, { context, input, location }, parser) {
2928
input.moveTo(location)
30-
return parser.parseCSSValue(input, '<general-enclosed>', context) ?? error
29+
return parser.parseCSSValue(input, '<general-enclosed>', context, 'lazy') ?? error
3130
}
3231

3332
module.exports = {

0 commit comments

Comments
 (0)