Skip to content
This repository was archived by the owner on Jun 6, 2022. It is now read-only.

Commit 4385120

Browse files
committed
Split rules on whitespace, not only on spaces
1 parent 9e24886 commit 4385120

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function customSelector(options) {
2828
return
2929
}
3030

31-
var params = rule.params.split(" ")
31+
var params = rule.params.split(/\s+/)
3232
// @custom-selector = @custom-selector <extension-name> <selector>
3333
// map[<extension-name>] = <selector>
3434

test/fixtures/multiline.css

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@custom-selector :--multiline
2+
.foo
3+
;
4+
5+
:--multiline {
6+
display: block;
7+
}

test/fixtures/multiline.expected.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.foo {
2+
display: block;
3+
}

test/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ function compareFixtures(t, name, msg, opts, postcssOpts) {
2121
test("@custom-selector", function(t) {
2222
compareFixtures(t, "heading", "should transform custom selector")
2323
compareFixtures(t, "pseudo", "should transform custom selector")
24+
compareFixtures(t, "multiline", "should transform custom selector")
2425

2526
compareFixtures(t, "extension", "local extensions", {
2627
extensions: {

0 commit comments

Comments
 (0)