From: unknown Date: Thu, 12 Aug 2021 09:07:00 +0000 (+0530) Subject: fixed reply formatting X-Git-Tag: v1.2.0~37 X-Git-Url: https://git.wafflesoft.org/?a=commitdiff_plain;h=e730eb3a32c30424d64237886c2980c5101a6d88;p=cinny.git fixed reply formatting --- 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'] || {};