Skip to content

Commit db9d9f7

Browse files
committed
fix: svg bug
1 parent e508144 commit db9d9f7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ class CoCreateFileSystem {
144144
}
145145

146146
let contentType = file['content-type'] || 'text/html';
147-
if (contentType.startsWith('image/') || contentType.startsWith('audio/') || contentType.startsWith('video/')) {
147+
if (contentType === 'image/svg+xml')
148+
contentType = contentType
149+
else if (contentType.startsWith('image/') || contentType.startsWith('audio/') || contentType.startsWith('video/')) {
148150
src = src.replace(/^data:image\/(png|jpeg|jpg);base64,/, '');
149151
src = Buffer.from(src, 'base64');
150152
} else if (contentType === 'text/html') {

0 commit comments

Comments
 (0)