TagSpaces is an offline, open source, document manager with tagging support
fixing issues with embeding local images and images in data urls
Ilian80ce8800f049
diff --git a/data/ext/viewerBrowser/extension.js b/data/ext/viewerBrowser/extension.jsindex 917f84238..bb919de73 100644--- a/data/ext/viewerBrowser/extension.js+++ b/data/ext/viewerBrowser/extension.js@@ -79,6 +79,16 @@ define(function(require, exports, module) {e.preventDefault();TSCORE.openLinkExternally($(this).attr("href"));})++ // fixing embedding of local images+ $(viewerIframe.contentWindow.document).find( "img[src]").each(function(){+ var currentSrc = $( this ).attr("src");+ if(currentSrc.indexOf("http://") == 0 || currentSrc.indexOf("https://") == 0 || currentSrc.indexOf("data:") == 0) {+ // do nothing if src begins with http(s):// or data:+ } else {+ $( this ).attr("src","file://"+fileDirectory+TSCORE.dirSeparator+currentSrc);+ }+ });}};diff --git a/data/ext/viewerMD/extension.js b/data/ext/viewerMD/extension.jsindex ab8fef48a..a9872dfc8 100644--- a/data/ext/viewerMD/extension.js+++ b/data/ext/viewerMD/extension.js@@ -59,7 +59,7 @@ define(function(require, exports, module) {// fixing embedding of local images$('#'+containerElID+" img[src]").each(function(){var currentSrc = $( this ).attr("src");- if(currentSrc.indexOf("http://") == 0 || currentSrc.indexOf("https://") == 0) {+ if(currentSrc.indexOf("http://") == 0 || currentSrc.indexOf("https://") == 0 || currentSrc.indexOf("data:") == 0) {// do nothing if src begins with http(s)://} else {$( this ).attr("src","file://"+fileDirectory+TSCORE.dirSeparator+currentSrc);