Sha256: 55263483eda8a14cfe80626ec7853b160d91b9bffcc93ca1623a6bd760013897

Contents?: true

Size: 561 Bytes

Versions: 50

Compression:

Stored size: 561 Bytes

Contents

module Onebox
  module Engine
    class GiphyOnebox
      include Engine
      include StandardEmbed

      matches_regexp(/^https?:\/\/(giphy\.com\/gifs|gph\.is)\//)
      always_https

      def to_html
        oembed = get_oembed
        escaped_url = ::Onebox::Helpers.normalize_url_for_output(oembed[:url])

        <<-HTML
          <a href="#{escaped_url}" target="_blank">
            <img src="#{escaped_url}" width="#{oembed[:width]}" height="#{oembed[:height]}" #{Helpers.title_attr(oembed)}>
          </a>
        HTML
      end

    end
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
onebox-1.8.34 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.33 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.32 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.31 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.30 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.29 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.28 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.27 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.26 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.25 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.24 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.23 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.22 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.21 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.20 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.19 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.18 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.17 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.16 lib/onebox/engine/giphy_onebox.rb
onebox-1.8.15 lib/onebox/engine/giphy_onebox.rb