From 24f72923e4893ef6812cd1d47358d22c4718f711 Mon Sep 17 00:00:00 2001 From: heycalmdown Date: Fri, 4 Oct 2019 10:43:12 +0900 Subject: [PATCH] fix: no display URI encoded background --- src/plugin.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugin.ts b/src/plugin.ts index 91934265..28e8ff3d 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -52,7 +52,10 @@ export function backgroundImage(req) { const originalSize = !img.attr('height') && !img.attr('width'); const isEmoticon = img.hasClass('emoticon'); if (!originalSize || isEmoticon) return; - section.background = hostToAbsolute(req) + '/image' + sanitizeImageSrc(img.data('image-src')); + + // 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')); img.remove(); });