mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Fix a nokogiri deprecation (#16060)
``` warning: Passing a Node as the second parameter to Node.new is deprecated. Please pass a Document instead, or prefer an alternative constructor like Node#add_child. This will become an error in a future release of Nokogiri. ```
This commit is contained in:
parent
4020738eed
commit
ff530264f4
@ -330,8 +330,9 @@ module CookedProcessorMixin
|
|||||||
end
|
end
|
||||||
|
|
||||||
def create_node(tag_name, klass)
|
def create_node(tag_name, klass)
|
||||||
node = Nokogiri::XML::Node.new(tag_name, @doc)
|
node = @doc.document.create_element(tag_name)
|
||||||
node["class"] = klass if klass.present?
|
node["class"] = klass if klass.present?
|
||||||
|
@doc.add_child(node)
|
||||||
node
|
node
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user