From e730eb3a32c30424d64237886c2980c5101a6d88 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Aug 2021 14:37:00 +0530 Subject: [PATCH] fixed reply formatting --- src/client/state/RoomsInput.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/state/RoomsInput.js b/src/client/state/RoomsInput.js index c298ff5..584fefa 100644 --- a/src/client/state/RoomsInput.js +++ b/src/client/state/RoomsInput.js @@ -90,12 +90,13 @@ function getFormattedBody(markdown) { function getReplyFormattedBody(roomId, reply) { const replyToLink = `In reply to`; const userLink = `${reply.userId}`; - return `
${replyToLink}${userLink}
${reply.content}
`; + const formattedReply = getFormattedBody(reply.content.replaceAll('\n', '\n> ')); + return `
${replyToLink}${userLink}
${formattedReply}
`; } function bindReplyToContent(roomId, reply, content) { const newContent = { ...content }; - newContent.body = `> <${reply.userId}> ${reply.content}`; + newContent.body = `> <${reply.userId}> ${reply.content.replaceAll('\n', '\n> ')}`; newContent.body += `\n\n${content.body}`; newContent.format = 'org.matrix.custom.html'; newContent['m.relates_to'] = content['m.relates_to'] || {};