Skip to content
Snippets Groups Projects

Fix attachment image

Merged Igor Markin requested to merge fix-attachment-image into master
1 file
+ 3
2
Compare changes
  • Side-by-side
  • Inline
@@ -301,7 +301,8 @@ export function getHTML(mime, parts) {
@@ -301,7 +301,8 @@ export function getHTML(mime, parts) {
continue;
continue;
}
}
contentDisposition = contentDisposition[0];
contentDisposition = contentDisposition[0];
if (contentDisposition.indexOf("inline") >= 0) {
if (contentDisposition.indexOf("attachment") >= 0 || contentDisposition.indexOf("inline") >= 0) {
 
let contentId = getHeaderValue("content-id", parts[i]);
let contentId = getHeaderValue("content-id", parts[i]);
if (contentId === null || contentId === undefined) {
if (contentId === null || contentId === undefined) {
continue;
continue;
@@ -315,7 +316,7 @@ export function getHTML(mime, parts) {
@@ -315,7 +316,7 @@ export function getHTML(mime, parts) {
if (contentType === null || contentType === undefined) {
if (contentType === null || contentType === undefined) {
continue;
continue;
}
}
contentType = contentType[0];
contentType = contentType[0].split(";")[0];
const normalizedBody = getBody(mime, parts[i]).replace(newline, "");
const normalizedBody = getBody(mime, parts[i]).replace(newline, "");
const src = "data:" + contentType + ";base64, " + normalizedBody;
const src = "data:" + contentType + ";base64, " + normalizedBody;
html = html.split(contentId).join(src);
html = html.split(contentId).join(src);
Loading