1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-13 22:12:50 +02:00

Electron: Resolves #594: Enable support for SVG graphics

This commit is contained in:
Laurent Cozic
2018-06-30 19:05:45 +01:00
parent 463b1441d3
commit 08ee939951
2 changed files with 2 additions and 2 deletions

View File

@@ -115,7 +115,7 @@ class MdToHtml {
if (!resource.id) return ''; // Resource is being loaded
const mime = resource.mime ? resource.mime.toLowerCase() : '';
if (mime == 'image/png' || mime == 'image/jpg' || mime == 'image/jpeg' || mime == 'image/gif') {
if (Resource.isSupportedImageMimeType(mime)) {
let src = './' + Resource.filename(resource);
if (this.resourceBaseUrl_ !== null) src = this.resourceBaseUrl_ + src;
let output = '<img data-resource-id="' + resource.id + '" title="' + htmlentities(title) + '" src="' + src + '"/>';

View File

@@ -26,7 +26,7 @@ class Resource extends BaseItem {
}
static isSupportedImageMimeType(type) {
const imageMimeTypes = ["image/jpg", "image/jpeg", "image/png", "image/gif"];
const imageMimeTypes = ["image/jpg", "image/jpeg", "image/png", "image/gif", "image/svg+xml"];
return imageMimeTypes.indexOf(type.toLowerCase()) >= 0;
}