mirror of
https://github.com/lingble/chatwoot.git
synced 2026-01-08 13:31:36 +00:00
fix: Remove style tags from email content (#2515)
This commit is contained in:
@@ -76,6 +76,8 @@ import contentTypeMixin from 'shared/mixins/contentTypeMixin';
|
||||
import BubbleActions from './bubble/Actions';
|
||||
import { MESSAGE_TYPE, MESSAGE_STATUS } from 'shared/constants/messages';
|
||||
import { generateBotMessageContent } from './helpers/botMessageContentHelper';
|
||||
import { stripStyleCharacters } from './helpers/EmailContentParser';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
BubbleActions,
|
||||
@@ -116,12 +118,10 @@ export default {
|
||||
} = this.contentAttributes;
|
||||
|
||||
if ((replyHTMLContent || fullHTMLContent) && this.isIncoming) {
|
||||
let parsedContent = new DOMParser().parseFromString(
|
||||
replyHTMLContent || fullHTMLContent || '',
|
||||
'text/html'
|
||||
);
|
||||
if (!parsedContent.getElementsByTagName('parsererror').length) {
|
||||
return parsedContent.body.innerHTML;
|
||||
let contentToBeParsed = replyHTMLContent || fullHTMLContent || '';
|
||||
const parsedContent = stripStyleCharacters(contentToBeParsed);
|
||||
if (parsedContent) {
|
||||
return parsedContent;
|
||||
}
|
||||
}
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user