fix: Formatting issue with reply preview content (#13399)

This commit is contained in:
Sivin Varghese 2026-01-30 16:35:32 +05:30 committed by GitHub
parent 81307d5aea
commit 85324c82fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,6 +7,7 @@ import { emitter } from 'shared/helpers/mitt';
import { useMessageContext } from '../provider.js'; import { useMessageContext } from '../provider.js';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import MessageFormatter from 'shared/helpers/MessageFormatter.js';
import { BUS_EVENTS } from 'shared/constants/busEvents'; import { BUS_EVENTS } from 'shared/constants/busEvents';
import { MESSAGE_VARIANTS, ORIENTATION } from '../constants'; import { MESSAGE_VARIANTS, ORIENTATION } from '../constants';
@ -80,7 +81,7 @@ const replyToPreview = computed(() => {
const { content, attachments } = inReplyTo.value; const { content, attachments } = inReplyTo.value;
if (content) return content; if (content) return new MessageFormatter(content).formattedMessage;
if (attachments?.length) { if (attachments?.length) {
const firstAttachment = attachments[0]; const firstAttachment = attachments[0];
const fileType = firstAttachment.fileType ?? firstAttachment.file_type; const fileType = firstAttachment.fileType ?? firstAttachment.file_type;
@ -107,9 +108,10 @@ const replyToPreview = computed(() => {
class="p-2 -mx-1 mb-2 rounded-lg cursor-pointer bg-n-alpha-black1" class="p-2 -mx-1 mb-2 rounded-lg cursor-pointer bg-n-alpha-black1"
@click="scrollToMessage" @click="scrollToMessage"
> >
<span class="break-all line-clamp-2"> <div
{{ replyToPreview }} v-dompurify-html="replyToPreview"
</span> class="prose prose-bubble line-clamp-2"
/>
</div> </div>
<slot /> <slot />
<MessageMeta <MessageMeta