Skip to content

Commit 36d832f

Browse files
authored
Merge 1806b17 into c29c15a
2 parents c29c15a + 1806b17 commit 36d832f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Property/Selector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Sabberworm\CSS\Renderable;
1010

1111
use function Safe\preg_match;
12+
use function Safe\preg_replace;
1213

1314
/**
1415
* Class representing a single CSS selector. Selectors have to be split by the comma prior to being passed into this
@@ -74,7 +75,7 @@ public function getSelector(): string
7475

7576
public function setSelector(string $selector): void
7677
{
77-
$this->selector = \trim($selector);
78+
$this->selector = preg_replace('/\s{1,}/', ' ', \trim($selector));
7879
}
7980

8081
/**

tests/ParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ public function selectorIgnoresInFile(): void
771771
$document = self::parsedStructureForFile('selector-ignores', Settings::create()->withMultibyteSupport(true));
772772
$expected = '.some[selectors-may=\'contain-a-{\'] {}'
773773
. "\n"
774-
. '.this-selector .valid {width: 100px;}'
774+
. '.this-selector .valid {width: 100px;}'
775775
. "\n"
776776
. '@media only screen and (min-width: 200px) {.test {prop: val;}}';
777777
self::assertSame($expected, $document->render());

0 commit comments

Comments
 (0)