Skip to content

Commit

Permalink
fix: no display remote background image
Browse files Browse the repository at this point in the history
  • Loading branch information
heycalmdown committed Oct 4, 2019
1 parent 24f7292 commit 30a2762
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 30a2762

Please sign in to comment.