mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: vimeo iframe url when data-original-href is missing (#18894)
This commit is contained in:

committed by
GitHub

parent
bdf8815b71
commit
96a6bb69b5
@ -527,7 +527,7 @@ module PrettyText
|
||||
if iframe["data-original-href"].present?
|
||||
vimeo_url = UrlHelper.normalized_encode(iframe["data-original-href"])
|
||||
else
|
||||
vimeo_id = iframe["src"].split("/").last
|
||||
vimeo_id = iframe["src"].split("/").last.sub("?h=", "/")
|
||||
vimeo_url = "https://vimeo.com/#{vimeo_id}"
|
||||
end
|
||||
iframe.replace Nokogiri::HTML5.fragment("<p><a href='#{vimeo_url}'>#{vimeo_url}</a></p>")
|
||||
|
Reference in New Issue
Block a user