Skip to content

Commit 291c1e9

Browse files
Merge branch '4.4' into 5.4
* 4.4: [DowCrawler] Fix locale-sensitivity of whitespace normalization suggest to install the Twig bundle when the required component is already installed Update PULL_REQUEST_TEMPLATE.md
2 parents 0b900ca + 4b8daf6 commit 291c1e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Crawler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ public function text(string $default = null, bool $normalizeWhitespace = true)
623623
$text = $this->getNode(0)->nodeValue;
624624

625625
if ($normalizeWhitespace) {
626-
return trim(preg_replace('/(?:\s{2,}+|[^\S ])/', ' ', $text));
626+
return trim(preg_replace("/(?:[ \n\r\t\x0C]{2,}+|[\n\r\t\x0C])/", ' ', $text), " \n\r\t\x0C");
627627
}
628628

629629
return $text;

0 commit comments

Comments
 (0)