# frozen_string_literal: true module Onebox module Engine class RedditMediaOnebox include Engine include StandardEmbed matches_regexp(/^https?:\/\/(www\.)?reddit\.com/) def to_html if raw[:type] == "image" <<-HTML HTML elsif raw[:type] =~ /^video[\/\.]/ <<-HTML HTML else html = Onebox::Engine::AllowlistedGenericOnebox.new(@url, @timeout).to_html return if Onebox::Helpers.blank?(html) html end end end end end