diff --git a/lib/pretty_text.rb b/lib/pretty_text.rb index c32f6034298..7f06bb6893c 100644 --- a/lib/pretty_text.rb +++ b/lib/pretty_text.rb @@ -375,8 +375,13 @@ module PrettyText def self.convert_vimeo_iframes(doc) doc.css("iframe[src*='player.vimeo.com']").each do |iframe| - vimeo_id = iframe['src'].split('/').last - iframe.replace "

https://vimeo.com/#{vimeo_id}

" + if iframe["data-original-href"].present? + vimeo_url = iframe["data-original-href"] + else + vimeo_id = iframe['src'].split('/').last + vimeo_url = "https://vimeo.com/#{vimeo_id}" + end + iframe.replace "

#{vimeo_url}

" end end