From 01ad237af308788467e08f73ec919a7ea9cc122d Mon Sep 17 00:00:00 2001 From: fish Date: Wed, 15 Jul 2026 23:47:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20TextFormatter=20actor=20?= =?UTF-8?q?=E9=9A=94=E7=A6=BB=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Note/TextFormatter.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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)