mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 08:43:25 +08: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
|
||||
|
||||
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?
|
||||
@doc.add_child(node)
|
||||
node
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user