From 751d1d2523e1ac88f0c56c4c6743277814a099c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobi=20Sch=C3=A4fer?= Date: Sun, 24 May 2020 13:06:51 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20=E2=80=9Cnull=E2=80=9D=20string=20showin?= =?UTF-8?q?g=20in=20alt/title=20attributes=20of=20images?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/Image/Image.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/Image/Image.js b/code/Image/Image.js index 5fd56517..ba0ec1f0 100644 --- a/code/Image/Image.js +++ b/code/Image/Image.js @@ -399,7 +399,7 @@ Image.prototype.thumbnail_macro = function(param) { return this.render_macro(param); } param.src = encodeURI(this.getUrl(this.getThumbnailFile().getName())); - param.title || (param.title = encode(this.description)); + if (!param.title) { param.title = encode(this.description || ''); } param.alt = encode(param.alt || param.title); var width = param.width || this.thumbnailWidth; var height = param.height || this.thumbnailHeight; @@ -421,7 +421,7 @@ Image.prototype.thumbnail_macro = function(param) { */ Image.prototype.render_macro = function(param) { param.src = encodeURI(this.getUrl()); - param.title || (param.title = encode(this.description)); + if (!param.title) { param.title = encode(this.description || ''); } param.alt = encode(param.alt || param.title); var style = []; param.width && style.push('width:', param.width + 'px;');