aboutsummaryrefslogtreecommitdiff
path: root/Hotline/Utility
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2024-05-22 11:40:53 -0700
committerDustin Mierau <dustin@mierau.me>2024-05-22 11:40:53 -0700
commitc7a2970c7f17a1b19a76d9cb6addda8fb877a63a (patch)
tree20f52495dd9e599d7b3942ba8357c79bc394822d /Hotline/Utility
parent39255f49250e3b0ccbd42661614a7c8a3e0d4fb7 (diff)
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.
Diffstat (limited to 'Hotline/Utility')
-rw-r--r--Hotline/Utility/FoundationExtensions.swift22
1 files changed, 22 insertions, 0 deletions
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)