Skip to content

Commit 8cee321

Browse files
fix: Fixed Illegal RegExp in Safari in 3.0.0-beta.1 and beta.2 (#1444)
1 parent 3b72add commit 8cee321

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/src/processing/whitespace.dart

+1-2
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,7 @@ class WhitespaceProcessing {
226226
/// (4) Replace any instances of two or more spaces with a single space.
227227
static String _removeUnnecessaryWhitespace(String text) {
228228
return text
229-
.replaceAll(RegExp(r" *(?=\n)"), "")
230-
.replaceAll(RegExp(r"(?<=\n) *"), "")
229+
.replaceAll(RegExp(r" *\n *"), "\n")
231230
.replaceAll("\n", " ")
232231
.replaceAll("\t", " ")
233232
.replaceAll(RegExp(r" {2,}"), " ");

0 commit comments

Comments
 (0)