From acd24499c4c3390caa4a3e6ef0cb9c64c168a6f5 Mon Sep 17 00:00:00 2001 From: EdgeInfinity Date: Thu, 11 Sep 2025 01:53:34 +0800 Subject: [PATCH 1/2] Update FormatTextPreview.php --- src/Formatter/TextPreview/FormatTextPreview.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Formatter/TextPreview/FormatTextPreview.php b/src/Formatter/TextPreview/FormatTextPreview.php index c3a54fc2..481dbf71 100644 --- a/src/Formatter/TextPreview/FormatTextPreview.php +++ b/src/Formatter/TextPreview/FormatTextPreview.php @@ -47,7 +47,7 @@ public function __invoke(Renderer $renderer, $context, string $xml) if ($response->getStatusCode() === 200) { $file_contents = $response->getBody()->getContents(); - $lines = preg_split('/\R/', $file_contents); + $lines = preg_split('/\r\n|\n|\r/', $file_contents); $lines = array_filter($lines, 'trim'); if (count($lines) <= 5) { From 9aba1aa2895d3d2cfb53db2b9a662afe5cb8e198 Mon Sep 17 00:00:00 2001 From: EdgeInfinity Date: Wed, 17 Sep 2025 12:12:45 +0800 Subject: [PATCH 2/2] Update FormatTextPreview.php --- src/Formatter/TextPreview/FormatTextPreview.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Formatter/TextPreview/FormatTextPreview.php b/src/Formatter/TextPreview/FormatTextPreview.php index 481dbf71..c6c9d9e4 100644 --- a/src/Formatter/TextPreview/FormatTextPreview.php +++ b/src/Formatter/TextPreview/FormatTextPreview.php @@ -47,7 +47,7 @@ public function __invoke(Renderer $renderer, $context, string $xml) if ($response->getStatusCode() === 200) { $file_contents = $response->getBody()->getContents(); - $lines = preg_split('/\r\n|\n|\r/', $file_contents); + $lines = mb_split('\R', $file_contents); $lines = array_filter($lines, 'trim'); if (count($lines) <= 5) {