We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b5eec6 commit 82ab538Copy full SHA for 82ab538
lib/Sabberworm/CSS/Parser.php
@@ -524,7 +524,18 @@ private function consumeWhiteSpace() {
524
while (preg_match('/\\s/isSu', $this->peek()) === 1) {
525
$this->consume(1);
526
}
527
- } while ($this->consumeComment());
+ if($this->oParserSettings->bLenientParsing) {
528
+ try {
529
+ $bHasComment = $this->consumeComment();
530
+ } catch(UnexpectedTokenException $e) {
531
+ // When we can’t find the end of a comment, we assume the document is finished.
532
+ $this->iCurrentPosition = $this->iLength;
533
+ return;
534
+ }
535
+ } else {
536
537
538
+ } while($bHasComment);
539
540
541
private function consumeComment() {
0 commit comments