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 3fd7a54 commit 8dd6ffcCopy full SHA for 8dd6ffc
src/index.js
@@ -152,9 +152,12 @@ class CoCreateFileSystem {
152
}
153
154
let contentType = file['content-type'] || 'text/html';
155
- if (/^[A-Za-z0-9+/]+[=]{0,2}$/.test(src)) {
+ // const cleanedSrc = src.replace(/\s/g, '');
156
+ if (/^data:image\/[a-zA-Z0-9+.-]+;base64,([A-Za-z0-9+/]+={0,2})$/.test(src)) {
157
src = src.replace(/^data:image\/(png|jpeg|jpg);base64,/, '');
158
src = Buffer.from(src, 'base64');
159
+ } else if (/^([A-Za-z0-9+/]+={0,2})$/.test(src)) {
160
+ src = Buffer.from(src, 'base64');
161
} else if (contentType === 'text/html') {
162
try {
163
src = await this.render.HTML(src, organization_id);
0 commit comments