1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Electron: fixed loading of resources, and disable drag and dropping of links in app

This commit is contained in:
Laurent Cozic
2017-11-21 19:31:21 +00:00
parent f5feb595f6
commit 367a18db93
4 changed files with 23 additions and 2 deletions

View File

@ -14,6 +14,9 @@ class MdToHtml {
this.loadedResources_ = {};
this.cachedContent_ = null;
this.cachedContentKey_ = null;
// Must include last "/"
this.resourceBaseUrl_ = ('resourceBaseUrl' in options) ? options.resourceBaseUrl : null;
}
makeContentKey(resources, body, style, options) {
@ -100,7 +103,8 @@ class MdToHtml {
const mime = resource.mime ? resource.mime.toLowerCase() : '';
if (mime == 'image/png' || mime == 'image/jpg' || mime == 'image/jpeg' || mime == 'image/gif') {
const src = './' + Resource.filename(resource);
let src = './' + Resource.filename(resource);
if (this.resourceBaseUrl_ !== null) src = this.resourceBaseUrl_ + src;
let output = '<img title="' + htmlentities(title) + '" src="' + src + '"/>';
return output;
}