inline images work now

This commit is contained in:
or-else
2017-09-25 21:00:35 -07:00
parent 3e8fd9d6e6
commit 0a96014484
4 changed files with 239 additions and 68 deletions
+17 -7
View File
@@ -89,7 +89,7 @@ Sample JSON representation of the text above:
LN: { name: 'a', isVoid: false },
MN: { name: 'a', isVoid: false },
HT: { name: 'a', isVoid: false },
IM: { name: 'img', isVoid: true }
IM: { name: ['a','img'], isVoid: true }
};
// Convert base64-encoded string into Blob.
@@ -141,12 +141,18 @@ Sample JSON representation of the text above:
return (data.name ? '</a>' : '');
},
props: function(data) {
return {
src: base64toObjectUrl(data.val, data.mime),
width: data.width,
height: data.height,
download: data.name
};
var url = base64toObjectUrl(data.val, data.mime);
return [
{
download: data.name,
href: url
},
{
src: url,
width: data.width,
height: data.height,
}
];
},
}
};
@@ -703,6 +709,10 @@ Sample JSON representation of the text above:
// Value is base64 encoded. The actual object size is smaller than the encoded length.
return entity.val ? (entity.val.length * 0.75) | 0 : 0;
},
getAttachmentType: function(entity) {
return entity.mime || "text/plain";
},
/**
* Get HTML tag for a given two-letter style name
* @param {string} style - two-letter style, like ST or LN