From 1e82b477e60a4f7e4ab0573bd23fac5fd4dc3cbc Mon Sep 17 00:00:00 2001 From: nambiarAswathi <135691535+nambiarAswathi@users.noreply.github.com> Date: Wed, 9 Oct 2024 12:25:57 +0200 Subject: [PATCH] Illegal RegExp in Safari in 3.0.0-beta.1 and beta.2 --- lib/src/processing/whitespace.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/src/processing/whitespace.dart b/lib/src/processing/whitespace.dart index 6dc2e74a3f..bf5cf40277 100644 --- a/lib/src/processing/whitespace.dart +++ b/lib/src/processing/whitespace.dart @@ -226,8 +226,7 @@ class WhitespaceProcessing { /// (4) Replace any instances of two or more spaces with a single space. static String _removeUnnecessaryWhitespace(String text) { return text - .replaceAll(RegExp(r" *(?=\n)"), "") - .replaceAll(RegExp(r"(?<=\n) *"), "") + .replaceAll(RegExp(r" *\n *"), "\n") .replaceAll("\n", " ") .replaceAll("\t", " ") .replaceAll(RegExp(r" {2,}"), " ");