FIX: ensures generic onebox has width/height for thumbnail (#23040)

Prior to this fix we would output an image with no width/height which would then bypass a large part of `CookedProcessorMixin` and have no aspect ratio. As a result, an image with no size would cause layout shift.

It also removes a fix for oneboxes in chat messages due to this case.
This commit is contained in:
Joffrey JAFFEUX
2023-08-09 20:31:11 +02:00
committed by GitHub
parent 6801cf34cc
commit df7dab9dce
5 changed files with 110 additions and 2 deletions

View File

@ -257,6 +257,11 @@ module Onebox
end
def article_html
if data[:image]
data[:thumbnail_width] ||= data[:image_width] || data[:width]
data[:thumbnail_height] ||= data[:image_height] || data[:height]
end
layout.to_html
end