lib/scrivito/content_conversion.rb in scrivito_sdk-0.16.0 vs lib/scrivito/content_conversion.rb in scrivito_sdk-0.17.0
- old
+ new
@@ -26,18 +26,22 @@
new_html.gsub(nbsp, " ")
end
def self.convert_linklist_urls(linklist, request_host, request_port)
linklist.map do |link_data|
- if link_data.has_key?(:url)
- link_data.delete(:obj_id)
- url = link_data.delete(:url)
- link = Link.parse(url, request_host, request_port)
- link_data.merge!(link.to_cms_api_linklist_params)
- end
+ convert_link(link_data, request_host, request_port)
+ end
+ end
- link_data
+ def self.convert_link(link_data, request_host, request_port)
+ if link_data && link_data.has_key?(:url)
+ link_data.delete(:obj_id)
+ url = link_data.delete(:url)
+ link = Link.parse(url, request_host, request_port)
+ link_data.merge!(link.to_cms_api_linklist_params)
end
+
+ link_data
end
end
end