fix: plain text with valid HTML not rendering [CW-5577] (#12369)

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
This commit is contained in:
Shivam Mishra
2025-09-04 12:50:49 +05:30
committed by GitHub
parent ce1690eeb1
commit 0e481a690c
3 changed files with 11 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
<script setup>
import { computed, useTemplateRef, ref, onMounted } from 'vue';
import { Letter } from 'vue-letter';
import { sanitizeTextForRender } from '@chatwoot/utils';
import { allowedCssProperties } from 'lettersanitizer';
import Icon from 'next/icon/Icon.vue';
@@ -37,11 +38,13 @@ const { hasTranslations, translationContent } =
const originalEmailText = computed(() => {
const text =
contentAttributes?.value?.email?.textContent?.full ?? content.value;
return text?.replace(/\n/g, '<br>');
return sanitizeTextForRender(text);
});
const originalEmailHtml = computed(
() => contentAttributes?.value?.email?.htmlContent?.full || ''
() =>
contentAttributes?.value?.email?.htmlContent?.full ||
originalEmailText.value
);
const messageContent = computed(() => {