FIX: Normalize and decode html entities for image URL.

FIX: Normalize and decode html entities for image URL.

diff --git a/lib/onebox/engine/whitelisted_generic_onebox.rb b/lib/onebox/engine/whitelisted_generic_onebox.rb
index f77224e..a38e56a 100644
--- a/lib/onebox/engine/whitelisted_generic_onebox.rb
+++ b/lib/onebox/engine/whitelisted_generic_onebox.rb
@@ -220,6 +220,7 @@ module Onebox
           # prefer secure URLs
           d[:image] = d[:image_secure_url] || d[:image_url] || d[:thumbnail_url] || d[:image]
           d[:image] = Onebox::Helpers::get_absolute_image_url(d[:image], @url)
+          d[:image] = Onebox::Helpers::normalize_url_for_output(html_entities.decode(d[:image]))
 
           d[:video] = d[:video_secure_url] || d[:video_url] || d[:video]

GitHub sha: faa5ef8b

1 Like

This commit has been mentioned on Discourse Meta. There might be relevant details there: