fix for youtube src

This commit is contained in:
Adrian Hinz 2022-10-22 16:10:14 +02:00
parent 4a462d450e
commit 1c81dd02c5
1 changed files with 6 additions and 1 deletions

View File

@ -177,7 +177,12 @@ class Dotation < ApplicationRecord
ret = full_descr
doc = Nokogiri::HTML(ret)
doc.css('iframe').each do |iframe|
if iframe['src'].include? 'https'
url = iframe['src']
else
url = 'https:' + iframe['src']
end
new_node = doc.create_element 'a'
new_node['href'] = url
new_node.inner_html = url