From f5cc28d740b2775b4b99a0f77d4d5fe6ba236531 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 1 Nov 2017 16:42:56 +1100 Subject: [PATCH] UX: correct regression with twitter onebox --- lib/cooked_post_processor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cooked_post_processor.rb b/lib/cooked_post_processor.rb index 31da056aa54..bf66b29e72f 100644 --- a/lib/cooked_post_processor.rb +++ b/lib/cooked_post_processor.rb @@ -326,7 +326,7 @@ class CookedPostProcessor # and wrap in a div oneboxed_images.each do |img| limit_size!(img) - if (width = img["width"].to_i) > 0 && (height = img["height"].to_i) > 0 + if img.parent["class"].include?("onbox-body") && (width = img["width"].to_i) > 0 && (height = img["height"].to_i) > 0 img.delete('width') img.delete('height') new_parent = img.add_next_sibling("
")