Closed MatzFan closed 1 year ago
The argument should be given as an array, like: permitted_classes: [ Nokogiri::XML::NodeSet ]
.
@olleolleolle my bad. At least the error is now clearer, looks like it can't be done:
Tried to load unspecified class: Nokogiri::HTML5::Document (Psych::DisallowedClass)
If I can't deserialize Nokogiri Documents or NodeSets I'll store the HTML as text. Closing & thanks.
For clarity and completeness: Note that the list of permitted classes may have many known-by-you class names.
I am trying to store and read back from a file a Nokogiri::XML::NodeSet object, using YAML.
I can serialize it OK, but when trying to deserialize it psych raises this error.
MRE:
Stack trace from the last line:
If I replace the last line with
I get this:
The serialized object looks like this:-
Is this a bug or is there some reason I can't deserialize this object?