fix: Formatting issue with reply preview content (#13399)
This commit is contained in:
parent
81307d5aea
commit
85324c82fa
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user