Skip to content

Commit 0145442

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
1 parent 5eb661e commit 0145442

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

AbstractString.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ abstract public function chunk(int $length = 1): array;
245245
public function collapseWhitespace(): self
246246
{
247247
$str = clone $this;
248-
$str->string = trim(preg_replace('/(?:\s{2,}+|[^\S ])/', ' ', $str->string));
248+
$str->string = trim(preg_replace("/(?:[ \n\r\t\x0C]{2,}+|[\n\r\t\x0C])/", ' ', $str->string), " \n\r\t\x0C");
249249

250250
return $str;
251251
}

0 commit comments

Comments
 (0)