Skip to content

Commit

Permalink
Merge branch '6.0' into 6.1
Browse files Browse the repository at this point in the history
* 6.0:
  [String] Fix snake conversion
  [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
  [Serializer] Fix throwing right exception in ArrayDenormalizer with invalid type
  • Loading branch information
derrabus committed Aug 4, 2022
2 parents 58eb985 + c69331e commit 8cb4c6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ public function text(string $default = null, bool $normalizeWhitespace = true):
$text = $this->getNode(0)->nodeValue;

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

return $text;
Expand Down

0 comments on commit 8cb4c6e

Please sign in to comment.