mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 18:24:52 -06:00
DEV: remove deprecation warnings related to Nokogiri
This commit is contained in:
parent
43ef44127c
commit
ca97850726
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user