Sha256: d04ee908c948e3c798ec0f5a476480cbb346813222f0342d46cc2efcf22be3ce

Contents?: true

Size: 595 Bytes

Versions: 5

Compression:

Stored size: 595 Bytes

Contents

module Onebox
  module Engine
    class ReplitOnebox
      include Engine
      include StandardEmbed

      matches_regexp(/^https?:\/\/repl\.it\/.+/)
      always_https

      def placeholder_html
        oembed = get_oembed

        # we want the image to have the same dimensions as the embedded html

        <<-HTML
          <img src="#{oembed[:thumbnail_url]}" style="max-width: #{oembed[:width]}px; max-height: #{oembed[:height]}px;" #{Helpers.title_attr(oembed)}>
        HTML
      end

      def to_html
        oembed = get_oembed
        oembed[:html]
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
onebox-1.7.3 lib/onebox/engine/replit_onebox.rb
onebox-1.7.2 lib/onebox/engine/replit_onebox.rb
onebox-1.7.1 lib/onebox/engine/replit_onebox.rb
onebox-1.7.0 lib/onebox/engine/replit_onebox.rb
onebox-1.6.9 lib/onebox/engine/replit_onebox.rb