diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eef20b7..a0fabf7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,7 +43,6 @@ Please also have a look at our ### Fixed - 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) diff --git a/src/Rule/Rule.php b/src/Rule/Rule.php index e2a483ce..9770a0ad 100644 --- a/src/Rule/Rule.php +++ b/src/Rule/Rule.php @@ -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; } diff --git a/tests/ParserTest.php b/tests/ParserTest.php index 8bbbd69d..dcbcc1c0 100644 --- a/tests/ParserTest.php +++ b/tests/ParserTest.php @@ -1171,11 +1171,14 @@ public function flatCommentExtractingOneComment(): void self::assertCount(1, $comments); self::assertSame('Find Me!', $comments[0]->getComment()); } + /** * @test */ public function flatCommentExtractingTwoComments(): void { + self::markTestSkipped('This is currently broken.'); + $parser = new Parser('div {/*Find Me!*/left:10px; /*Find Me Too!*/text-align:left;}'); $document = $parser->parse(); $contents = $document->getContents(); diff --git a/tests/RuleSet/DeclarationBlockTest.php b/tests/RuleSet/DeclarationBlockTest.php index 871ed194..15430ae9 100644 --- a/tests/RuleSet/DeclarationBlockTest.php +++ b/tests/RuleSet/DeclarationBlockTest.php @@ -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();