Sha256: 27d398f149cf24543b0bba3e62616bbd48996efaf61b1fbd5f72c53f6d64123b

Contents?: true

Size: 595 Bytes

Versions: 84

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
        escaped_src = ::Onebox::Helpers.normalize_url_for_output(oembed[:thumbnail_url])

        <<-HTML
          <img src="#{escaped_src}" 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

84 entries across 84 versions & 1 rubygems

Version Path
onebox-1.8.38 lib/onebox/engine/replit_onebox.rb
onebox-1.8.36 lib/onebox/engine/replit_onebox.rb
onebox-1.8.35 lib/onebox/engine/replit_onebox.rb
onebox-1.8.34 lib/onebox/engine/replit_onebox.rb
onebox-1.8.33 lib/onebox/engine/replit_onebox.rb
onebox-1.8.32 lib/onebox/engine/replit_onebox.rb
onebox-1.8.31 lib/onebox/engine/replit_onebox.rb
onebox-1.8.30 lib/onebox/engine/replit_onebox.rb
onebox-1.8.29 lib/onebox/engine/replit_onebox.rb
onebox-1.8.28 lib/onebox/engine/replit_onebox.rb
onebox-1.8.27 lib/onebox/engine/replit_onebox.rb
onebox-1.8.26 lib/onebox/engine/replit_onebox.rb
onebox-1.8.25 lib/onebox/engine/replit_onebox.rb
onebox-1.8.24 lib/onebox/engine/replit_onebox.rb
onebox-1.8.23 lib/onebox/engine/replit_onebox.rb
onebox-1.8.22 lib/onebox/engine/replit_onebox.rb
onebox-1.8.21 lib/onebox/engine/replit_onebox.rb
onebox-1.8.20 lib/onebox/engine/replit_onebox.rb
onebox-1.8.19 lib/onebox/engine/replit_onebox.rb
onebox-1.8.18 lib/onebox/engine/replit_onebox.rb