diff --git a/app/models/account/field.rb b/app/models/account/field.rb index 2bada6954b40ff..bcd89015de022f 100644 --- a/app/models/account/field.rb +++ b/app/models/account/field.rb @@ -73,10 +73,10 @@ def character_limit end def extract_url_from_html - doc = Nokogiri::HTML(value).at_xpath('//body') + doc = Nokogiri::HTML5.fragment(value) return if doc.nil? - return if doc.children.size > 1 + return if doc.children.size != 1 element = doc.children.first