We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c90891 commit 5f725d0Copy full SHA for 5f725d0
client/assets/components/document/document_default/document_default.js
@@ -59,7 +59,11 @@
59
60
doc.lw_description = getField('description', doc);
61
62
- doc.lw_image = getField('image', doc);
+ var image = getField('image', doc);
63
+ // determine if image is base64 encoded and if so add appropriate prefix for img.src attribute
64
+ doc.lw_image = image ?
65
+ /^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/.test(image) ?
66
+ ('data:image/png;base64,' + image) : image : null;
67
68
doc.lw_url = getField('head_url', doc);
69
0 commit comments