Skip to content

Build your personal knowledge base with Trilium Notes

check for images happens before other methods in utils.isHtmlEmpty()

zadamb10c083560bb
diff --git a/src/public/javascripts/services/utils.js b/src/public/javascripts/services/utils.js
index c7889e6afb..e7f5eeb105 100644
--- a/src/public/javascripts/services/utils.js
+++ b/src/public/javascripts/services/utils.js
@@ -262,9 +262,10 @@ function isHtmlEmpty(html) {
html = html.toLowerCase();
- return $("<div>").html(html).text().trim().length === 0
- && !html.includes('<img')
- && !html.includes('<section');
+ return !html.includes('<img')
+ && !html.includes('<section')
+ // line below will actually attempt to load images so better to check for images first
+ && $("<div>").html(html).text().trim().length === 0;
}
async function clearBrowserCache() {