mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 07:06:47 +08:00
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:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user