Skip to content

Commit

Permalink
Change Account::Field parsing to use HTML5::DocumentFragment (mastodo…
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones authored Sep 8, 2024
1 parent afa2e25 commit 82161d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/account/field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 82161d8

Please sign in to comment.