mirror of
https://github.com/discourse/discourse.git
synced 2025-02-10 21:34:50 +00:00
19 lines
435 B
Ruby
19 lines
435 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Onebox
|
|
module Engine
|
|
class AnimatedImageOnebox
|
|
include Engine
|
|
include StandardEmbed
|
|
|
|
matches_regexp(/^https?:\/\/.*(giphy\.com|gph\.is|tenor\.com)\//)
|
|
always_https
|
|
|
|
def to_html
|
|
og = get_opengraph
|
|
"<img src='#{og.image}' width='#{og.image_width}' height='#{og.image_height}' class='animated onebox' #{og.title_attr}>"
|
|
end
|
|
end
|
|
end
|
|
end
|