File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -70,14 +70,17 @@ class ImageTransformer implements DomTransformer {
7070 message.findContentInfo (disposition: ContentDisposition .inline);
7171
7272 for (final info in inlineInfos) {
73+ //TODO inline elements should be added at their respective positions and not necessary below the text
7374 if (info.isImage) {
7475 final cid = info.cid;
75- if (! usedContentIds.contains (cid)) {
76- final part = message.getPart (info.fetchId)! ;
77- final data = toImageData (part, info.mediaType, configuration);
78- final imageElement = Element .html (
79- '<a href="cid://$cid "><img src="$data " alt="${info .fileName }" /></a>' );
80- document.body! .append (imageElement);
76+ if (cid == null || ! usedContentIds.contains (cid)) {
77+ final part = message.getPart (info.fetchId);
78+ if (part != null ) {
79+ final data = toImageData (part, info.mediaType, configuration);
80+ final imageElement = Element .html (
81+ '<a href="fetch://${info .fetchId }"><img src="$data " alt="${info .fileName }" /></a>' );
82+ document.body! .append (imageElement);
83+ }
8184 }
8285 }
8386 }
You can’t perform that action at this time.
0 commit comments