Skip to content
Snippets Groups Projects
Commit 7023a136 authored by Alexey Lunin's avatar Alexey Lunin
Browse files

Fix the issue when email html don't contains body tag

parent 5842eabb
Branches lunin-demo
No related tags found
1 merge request!53Ability to search and filter Inbox(Emails and Documents)
......@@ -110,14 +110,14 @@ export const extractHtmlBodyFromString = string => {
const extractBodyRegex = /<body.*?>([\s\S]+)<\/body>/gm;
const bodyMatch = extractBodyRegex.exec(string);
let body;
let body = string;
if (bodyMatch && bodyMatch[1]) {
body = bodyMatch[1]
.replace(/>\s+</gm, "><")
.replace(/<!--[\s\S]*?-->/gm, "")
.trim();
body = bodyMatch[1];
}
return body;
return body
.replace(/>\s+</gm, "><")
.replace(/<!--[\s\S]*?-->/gm, "")
.trim();
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment