git » sdk » commit 9d5716b

Preserve newlines in fallback quote

author Stephen Paul Weber
2024-07-02 20:32:27 UTC
committer Stephen Paul Weber
2024-07-02 20:32:27 UTC
parent 7d6cf8f5a32cda775dfc90056d949f198f1742f4

Preserve newlines in fallback quote

snikket/ChatMessage.hx +3 -3

diff --git a/snikket/ChatMessage.hx b/snikket/ChatMessage.hx
index 6558de9..5bbed24 100644
--- a/snikket/ChatMessage.hx
+++ b/snikket/ChatMessage.hx
@@ -283,14 +283,14 @@ class ChatMessage {
 			for (line in lines) {
 				if (!~/^(?:> ?){3,}/.match(line)) {
 					if (line.charAt(0) == ">") {
-						quoteText += ">" + line;
+						quoteText += ">" + line + "\n";
 					} else {
-						quoteText += "> " + line;
+						quoteText += "> " + line + "\n";
 					}
 				}
 			}
 			final reaction = EmojiUtil.isEmoji(StringTools.trim(body)) ? StringTools.trim(body) : null;
-			body = quoteText + "\n" + body;
+			body = quoteText + body;
 			final replyId = replyToM.isGroupchat ? replyToM.serverId : replyToM.localId;
 			if (replyId != null) {
 				final codepoints = StringUtil.codepointArray(quoteText);