discourse/lib/onebox/oembed.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
381 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Onebox
class Oembed < OpenGraph
def initialize(response)
@data = Onebox::Helpers.symbolize_keys(::MultiJson.load(response))
# never use oembed from WordPress 4.4 (it's broken)
data.delete(:html) if data[:html] && data[:html]["wp-embedded-content"]
end
def html
get(:html, nil, false)
end
end
end