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 bf49d7a commit 3dcea93Copy full SHA for 3dcea93
client/assets/components/document/document_default/document_default.js
@@ -60,7 +60,11 @@
60
61
doc.lw_description = getField('description', doc);
62
63
- doc.lw_image = getField('image', doc);
+ var image = getField('image', doc);
64
+ // determine if image is base64 encoded and if so add appropriate prefix for img.src attribute
65
+ doc.lw_image = image ?
66
+ /^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/.test(image) ?
67
+ ('data:image/png;base64,' + image) : image : null;
68
69
doc.lw_url = getField('head_url', doc);
70
0 commit comments