From 9a8c720632bea85afce18d53152542ec720404db Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Thu, 24 Feb 2022 22:33:08 +0800 Subject: [PATCH] UPE // No toleration to consecutive new lines. --- UserPhraseEditor/StringExtension.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UserPhraseEditor/StringExtension.swift b/UserPhraseEditor/StringExtension.swift index 1007a53d..8a7c703e 100644 --- a/UserPhraseEditor/StringExtension.swift +++ b/UserPhraseEditor/StringExtension.swift @@ -499,7 +499,7 @@ extension String { } // Step 5: Remove duplicated newlines at the end of the file. - strProcessed.regReplace(pattern: "\\n\\n", replaceWith: "\n") + strProcessed.regReplace(pattern: "\\n+", replaceWith: "\n") // Step 6: Commit Formatted Contents. self = strProcessed