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