diff --git a/CHANGELOG.md b/CHANGELOG.md index eafcfe5f..1428bf75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,6 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Fixed - Fix type errors in PHP strict mode (#695) -- Fix comment parsing to support multiple comments (#671) ## 8.6.0 diff --git a/src/Rule/Rule.php b/src/Rule/Rule.php index 9b693ece..80f2490f 100644 --- a/src/Rule/Rule.php +++ b/src/Rule/Rule.php @@ -108,11 +108,7 @@ public static function parse(ParserState $oParserState) $oParserState->consume(';'); } - // NOTE: This is a backport to fix comment parsing to support multiple - // comments. This will be rectified in version 9.0.0. - 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 200dcba8..c8e8ac76 100644 --- a/tests/ParserTest.php +++ b/tests/ParserTest.php @@ -1172,11 +1172,14 @@ public function flatCommentExtractingOneComment() self::assertCount(1, $comments); self::assertSame("Find Me!", $comments[0]->getComment()); } + /** * @test */ public function flatCommentExtractingTwoComments() { + self::markTestSkipped('This is currently broken.'); + $parser = new Parser('div {/*Find Me!*/left:10px; /*Find Me Too!*/text-align:left;}'); $doc = $parser->parse(); $contents = $doc->getContents(); diff --git a/tests/RuleSet/DeclarationBlockTest.php b/tests/RuleSet/DeclarationBlockTest.php index ea48f283..d37ece18 100644 --- a/tests/RuleSet/DeclarationBlockTest.php +++ b/tests/RuleSet/DeclarationBlockTest.php @@ -497,8 +497,6 @@ public function canRemoveCommentsFromRulesUsingStrictParsing( $cssWithComments, $cssWithoutComments ) { - self::markTestSkipped('This currently crashes, and we need to fix it.'); - $parserSettings = ParserSettings::create()->withLenientParsing(false); $document = (new Parser($cssWithComments, $parserSettings))->parse();