Skip to content

Commit 0729066

Browse files
committed
do we even need this?
1 parent 3a1e1ad commit 0729066

File tree

2 files changed

+3
-3
lines changed
  • packages/svelte

2 files changed

+3
-3
lines changed

packages/svelte/src/compiler/phases/1-parse/read/style.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ function read_selector(parser, inside_pseudo_class = false) {
290290
// nth of matcher must come before combinator matcher to prevent collision else the '+' in '+2n-1' would be parsed as a combinator
291291
children.push({
292292
type: 'Nth',
293-
value: /** @type {string} */ (parser.read(REGEX_NTH_OF)),
293+
value: /** @type {string} */ (parser.read(REGEX_NTH_OF)?.trimEnd()), // in case it ends with 'of'
294294
start,
295295
end: parser.index
296296
});

packages/svelte/tests/parser-modern/samples/css-nth-syntax/output.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"children": [
104104
{
105105
"type": "Nth",
106-
"value": "-n + 3 of ",
106+
"value": "-n + 3 of",
107107
"start": 130,
108108
"end": 140
109109
},
@@ -907,4 +907,4 @@
907907
"transparent": false
908908
},
909909
"options": null
910-
}
910+
}

0 commit comments

Comments
 (0)