mirror of
https://github.com/discourse/discourse.git
synced 2025-10-04 17:32:34 +08:00
DEV: remove deprecation warnings related to Nokogiri
This commit is contained in:
parent
43ef44127c
commit
ca97850726
1 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue