From 9efc900851acc71760c66f942163c966aafa87bc Mon Sep 17 00:00:00 2001 From: William Casarin Date: Fri, 18 Nov 2022 12:29:07 -0800 Subject: [PATCH] trim whitespace when posting --- damus/Views/PostView.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/damus/Views/PostView.swift b/damus/Views/PostView.swift index 6586726..97d2e19 100644 --- a/damus/Views/PostView.swift +++ b/damus/Views/PostView.swift @@ -42,7 +42,8 @@ struct PostView: View { if replying_to?.known_kind == .chat { kind = .chat } - let new_post = NostrPost(content: self.post, references: references, kind: kind) + let content = self.post.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines) + let new_post = NostrPost(content: content, references: references, kind: kind) NotificationCenter.default.post(name: .post, object: NostrPostResult.post(new_post)) dismiss()