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:
Jarek Radosz 2022-02-26 03:52:11 +01:00 committed by GitHub
parent 4020738eed
commit ff530264f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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