mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-22 17:38:07 +01:00
Change Account::Field parsing to use HTML5::DocumentFragment (#31813)
This commit is contained in:
parent
afa2e257e4
commit
82161d8ae5
1 changed files with 2 additions and 2 deletions
|
@ -73,10 +73,10 @@ class Account::Field < ActiveModelSerializers::Model
|
||||||
end
|
end
|
||||||
|
|
||||||
def extract_url_from_html
|
def extract_url_from_html
|
||||||
doc = Nokogiri::HTML(value).at_xpath('//body')
|
doc = Nokogiri::HTML5.fragment(value)
|
||||||
|
|
||||||
return if doc.nil?
|
return if doc.nil?
|
||||||
return if doc.children.size > 1
|
return if doc.children.size != 1
|
||||||
|
|
||||||
element = doc.children.first
|
element = doc.children.first
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue