From c7a2970c7f17a1b19a76d9cb6addda8fb877a63a Mon Sep 17 00:00:00 2001 From: Dustin Mierau Date: Wed, 22 May 2024 11:40:53 -0700 Subject: Redesign of Message Board post sheet. Tweaks to NewsEditor. Disable smart quotes in message board and news editor text view. Hide news section on older servers. --- Hotline/Utility/FoundationExtensions.swift | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Hotline/Utility') diff --git a/Hotline/Utility/FoundationExtensions.swift b/Hotline/Utility/FoundationExtensions.swift index ebd179a..14e76d5 100644 --- a/Hotline/Utility/FoundationExtensions.swift +++ b/Hotline/Utility/FoundationExtensions.swift @@ -7,6 +7,28 @@ enum Endianness { } extension String { +// func convertToPlainText() -> String { +// var newString = self +// +// let map: [Character: Character] = [ +// "“": ", +// "”": ", +// "‘": "'", +// "’": "'", +// "\n": "\r" +// ] +// +// newString = newString.replacingOccurrences(of: "\u{0060}", with: "'") +// newString = newString.replacingOccurrences(of: "\u{00b4}", with: "'") +// newString = newString.replacingOccurrences(of: "\u{2018}", with: "'") +// newString = newString.replacingOccurrences(of: "\u{2019}", with: "'") +// newString = newString.replacingOccurrences(of: "\u{201c}", with: "'") +// newString = newString.replacingOccurrences(of: "\u{201d}", with: "'") +// newString = newString.replacingOccurrences(of: "\"", with: "\"") +// +// return newString +// } + func replyToString() -> String { if self.range(of: "^Re:", options: [.regularExpression, .caseInsensitive]) != nil { return String(self) -- cgit