DEV: remove deprecation warnings related to Nokogiri

This commit is contained in:
Loïc Guitaut 2022-10-24 17:55:48 +02:00 committed by Loïc Guitaut
parent 43ef44127c
commit ca97850726

View File

@ -59,13 +59,13 @@ class HtmlToMarkdown
before, after = parent.children.slice_when { |n| n == br }.to_a
if before.size > 1
b = Nokogiri::XML::Node.new(parent.name, doc.document)
b = doc.document.create_element(parent.name)
before[0...-1].each { |c| b.add_child(c) }
parent.previous = b if b.inner_html.present?
end
if after.present?
a = Nokogiri::XML::Node.new(parent.name, doc.document)
a = doc.document.create_element(parent.name)
after.each { |c| a.add_child(c) }
parent.next = a if a.inner_html.present?
end