mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: show Vimeo links in embedded comments
This commit is contained in:
parent
f6c6f6e7a1
commit
5fd6c693d0
@ -22,6 +22,13 @@ module EmbedHelper
|
|||||||
youtube_link = "https://www.youtube.com/watch?v=#{youtube_id}"
|
youtube_link = "https://www.youtube.com/watch?v=#{youtube_id}"
|
||||||
yt_div.replace "<p><a href='#{youtube_link}'>#{youtube_link}</a></p>"
|
yt_div.replace "<p><a href='#{youtube_link}'>#{youtube_link}</a></p>"
|
||||||
end
|
end
|
||||||
|
# convert Vimeo iframe to link
|
||||||
|
fragment.css('iframe').each do |iframe|
|
||||||
|
if iframe['src'] =~ /player.vimeo.com/
|
||||||
|
vimeo_id = iframe['src'].split('/').last
|
||||||
|
iframe.replace "<p><a href='https://vimeo.com/#{vimeo_id}'>https://vimeo.com/#{vimeo_id}</a></p>"
|
||||||
|
end
|
||||||
|
end
|
||||||
raw fragment
|
raw fragment
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user