Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Property/Selector.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Sabberworm\CSS\Renderable;

use function Safe\preg_match;
use function Safe\preg_replace;

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

public function setSelector(string $selector): void
{
$this->selector = \trim($selector);
$this->selector = preg_replace('/\s{1,}/', ' ', \trim($selector));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ public function selectorIgnoresInFile(): void
$document = self::parsedStructureForFile('selector-ignores', Settings::create()->withMultibyteSupport(true));
$expected = '.some[selectors-may=\'contain-a-{\'] {}'
. "\n"
. '.this-selector .valid {width: 100px;}'
. '.this-selector .valid {width: 100px;}'
. "\n"
. '@media only screen and (min-width: 200px) {.test {prop: val;}}';
self::assertSame($expected, $document->render());
Expand Down
Loading