diff --git a/Note/TextFormatter.swift b/Note/TextFormatter.swift index f65561e..cf4bd28 100644 --- a/Note/TextFormatter.swift +++ b/Note/TextFormatter.swift @@ -9,7 +9,7 @@ import Foundation enum TextFormatter { - static func formatLog(_ text: String) -> String { + static nonisolated func formatLog(_ text: String) -> String { var content = text content = content.replacingOccurrences(of: "# ", with: "") @@ -31,7 +31,7 @@ enum TextFormatter { return content } - static func formatForCloud(_ text: String) -> String { + static nonisolated func formatForCloud(_ text: String) -> String { var content = formatForShortcut(text) content = "# " + content content = insertEmptyLineAfterFirstLine(content) @@ -81,7 +81,7 @@ enum TextFormatter { return content } - static func formatForNote(_ text: String) -> String { + static nonisolated func formatForNote(_ text: String) -> String { var content = text content = content.replacingOccurrences(of: "# ", with: "") content = content.replacingOccurrences(of: "#", with: "") @@ -116,13 +116,13 @@ enum TextFormatter { return result.trimmingCharacters(in: .whitespacesAndNewlines) } - static func removeEmptyLines(_ text: String) -> String { + static nonisolated func removeEmptyLines(_ text: String) -> String { let lines = text.components(separatedBy: .newlines) let nonEmptyLines = lines.filter { !$0.trimmingCharacters(in: .whitespaces).isEmpty } return nonEmptyLines.joined(separator: "\n") } - static func insertEmptyLineAfterFirstLine(_ text: String) -> String { + static nonisolated func insertEmptyLineAfterFirstLine(_ text: String) -> String { var lines = text.components(separatedBy: .newlines) if !lines.isEmpty { lines.insert("", at: 1)