From 30a27628da2067d9d6a7110f43703d160de9214e Mon Sep 17 00:00:00 2001 From: heycalmdown Date: Fri, 4 Oct 2019 11:21:22 +0900 Subject: [PATCH] fix: no display remote background image --- src/plugin.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugin.ts b/src/plugin.ts index 28e8ff3d..39c37dd7 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -55,8 +55,11 @@ export function backgroundImage(req) { // backgroundImage should be URI decoded const backgroundImage = decodeURI(sanitizeImageSrc(img.data('image-src'))); - section.background = hostToAbsolute(req) + '/image' + backgroundImage; - //section['background-image'] = req.baseUrl + '/image' + sanitizeImageSrc(img.data('image-src')); + if (backgroundImage.startsWith('http')) { + section.background = backgroundImage; + } else { + section.background = hostToAbsolute(req) + '/image' + backgroundImage; + } img.remove(); }); section.body = $.html();