fixed reply formatting
This commit is contained in:
parent
2933b6e732
commit
e730eb3a32
1 changed files with 3 additions and 2 deletions
|
@ -90,12 +90,13 @@ function getFormattedBody(markdown) {
|
||||||
function getReplyFormattedBody(roomId, reply) {
|
function getReplyFormattedBody(roomId, reply) {
|
||||||
const replyToLink = `<a href="https://matrix.to/#/${roomId}/${reply.eventId}">In reply to</a>`;
|
const replyToLink = `<a href="https://matrix.to/#/${roomId}/${reply.eventId}">In reply to</a>`;
|
||||||
const userLink = `<a href="https://matrix.to/#/${reply.userId}">${reply.userId}</a>`;
|
const userLink = `<a href="https://matrix.to/#/${reply.userId}">${reply.userId}</a>`;
|
||||||
return `<mx-reply><blockquote>${replyToLink}${userLink}<br />${reply.content}</blockquote></mx-reply>`;
|
const formattedReply = getFormattedBody(reply.content.replaceAll('\n', '\n> '));
|
||||||
|
return `<mx-reply><blockquote>${replyToLink}${userLink}<br />${formattedReply}</blockquote></mx-reply>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function bindReplyToContent(roomId, reply, content) {
|
function bindReplyToContent(roomId, reply, content) {
|
||||||
const newContent = { ...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.body += `\n\n${content.body}`;
|
||||||
newContent.format = 'org.matrix.custom.html';
|
newContent.format = 'org.matrix.custom.html';
|
||||||
newContent['m.relates_to'] = content['m.relates_to'] || {};
|
newContent['m.relates_to'] = content['m.relates_to'] || {};
|
||||||
|
|
Loading…
Reference in a new issue