Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Please also have a look at our

### Fixed

- Revert broken support for multiple comments (#740)
- Fix type errors in PHP strict mode (#664)
- Fix comment parsing to support multiple comments (#672)
- Fix undefined local variable in `CalcFunction::parse()` (#593)
- Fix PHP notice caused by parsing invalid color values having less than 6
characters (#485)
Expand Down
4 changes: 1 addition & 3 deletions src/Rule/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ public static function parse(ParserState $oParserState): Rule
$oParserState->consume(';');
}

while (\preg_match('/\\s/isSu', $oParserState->peek()) === 1) {
$oParserState->consume(1);
}
$oParserState->consumeWhiteSpace();

return $oRule;
}
Expand Down
16 changes: 0 additions & 16 deletions tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1171,22 +1171,6 @@ public function flatCommentExtractingOneComment(): void
self::assertCount(1, $comments);
self::assertSame('Find Me!', $comments[0]->getComment());
}
/**
* @test
*/
public function flatCommentExtractingTwoComments(): void
{
$parser = new Parser('div {/*Find Me!*/left:10px; /*Find Me Too!*/text-align:left;}');
$document = $parser->parse();
$contents = $document->getContents();
$divRules = $contents[0]->getRules();
$rule1Comments = $divRules[0]->getComments();
$rule2Comments = $divRules[1]->getComments();
self::assertCount(1, $rule1Comments);
self::assertCount(1, $rule2Comments);
self::assertEquals('Find Me!', $rule1Comments[0]->getComment());
self::assertEquals('Find Me Too!', $rule2Comments[0]->getComment());
}

/**
* @test
Expand Down
2 changes: 0 additions & 2 deletions tests/RuleSet/DeclarationBlockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,6 @@ public function canRemoveCommentsFromRulesUsingStrictParsing(
string $cssWithComments,
string $cssWithoutComments
): void {
self::markTestSkipped('This currently crashes, and we need to fix it.');

$parserSettings = ParserSettings::create()->withLenientParsing(false);
$document = (new Parser($cssWithComments, $parserSettings))->parse();

Expand Down
Loading