From 5013906bb5be1eec4994401cdc996e049d9d96a9 Mon Sep 17 00:00:00 2001 From: Ze Yu Date: Sat, 7 Mar 2020 12:59:10 +0800 Subject: [PATCH] Fix refactor to processDynamicResources --- src/lib/markbind/src/parser.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/markbind/src/parser.js b/src/lib/markbind/src/parser.js index fa4d061776..baae95cb46 100644 --- a/src/lib/markbind/src/parser.js +++ b/src/lib/markbind/src/parser.js @@ -211,11 +211,10 @@ class Parser { $('img, pic, thumbnail').each(function () { const elem = $(this); - const resourcePath = utils.ensurePosix(elem.attr('src')); - if (resourcePath === undefined || resourcePath === '') { - // Found empty img/pic resource in resourcePath + if (!elem.attr('src')) { return; } + const resourcePath = utils.ensurePosix(elem.attr('src')); if (utils.isAbsolutePath(resourcePath) || utils.isUrl(resourcePath)) { // Do not rewrite. return;