Add new tests for WysiwygComposer

This commit is contained in:
Florian Duros 2022-10-21 19:26:33 +02:00
parent c9bf7da629
commit 50c29502e4
No known key found for this signature in database
GPG key ID: 9700AA5870258A0B
11 changed files with 774 additions and 357 deletions

View file

@ -54,8 +54,8 @@ export function createMessageContent(
): IContent {
// TODO emote ?
const isReply = Boolean(replyToEvent?.replyEventId);
const isEditing = Boolean(editedEvent);
const isReply = isEditing ? Boolean(editedEvent?.replyEventId) : Boolean(replyToEvent);
/*const isEmote = containsEmote(model);
if (isEmote) {
@ -87,7 +87,7 @@ export function createMessageContent(
if (formattedBody) {
content.format = "org.matrix.custom.html";
const htmlPrefix = isReply ? getHtmlReplyFallback(editedEvent) : '';
const htmlPrefix = isReply && isEditing ? getHtmlReplyFallback(editedEvent) : '';
content.formatted_body = isEditing ? `${htmlPrefix} * ${formattedBody}` : formattedBody;
}