Skip to content
Snippets Groups Projects
Commit 6c36eeed authored by Gospodin Bodurov's avatar Gospodin Bodurov
Browse files

Merge branch 'fix-attachment-image' into 'master'

Fix attachment image

See merge request !72
parents 14e481f8 e963ceb7
No related branches found
No related tags found
1 merge request!72Fix attachment image
......@@ -301,7 +301,8 @@ export function getHTML(mime, parts) {
continue;
}
contentDisposition = contentDisposition[0];
if (contentDisposition.indexOf("inline") >= 0) {
if (contentDisposition.indexOf("attachment") >= 0 || contentDisposition.indexOf("inline") >= 0) {
let contentId = getHeaderValue("content-id", parts[i]);
if (contentId === null || contentId === undefined) {
continue;
......@@ -315,7 +316,7 @@ export function getHTML(mime, parts) {
if (contentType === null || contentType === undefined) {
continue;
}
contentType = contentType[0];
contentType = contentType[0].split(";")[0];
const normalizedBody = getBody(mime, parts[i]).replace(newline, "");
const src = "data:" + contentType + ";base64, " + normalizedBody;
html = html.split(contentId).join(src);
......
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