-
-
Couldn't load subscription status.
- Fork 928
Description
(Originally posted as [RFC] Deprecate Nokogiri::HTML4::ElementDescription · sparklemotion/nokogiri · Discussion #3311)
Resolved
Deprecate the class Nokogiri::HTML4::ElementDescription in a 1.x release, and remove it in a 2.x release.
Reasoning
The two HTML4 parsing libraries that are used by Nokogiri -- nekohtml and libxml2 -- have always had different metadata about HTML elements.1 And this metadata has even changed over time. 2.
In an upcoming release of libxml2, much of the metadata reported by that library will be removed.3
All of this leads me to the conclusions that:
- the metadata is not reliable or usable today
- the metadata will continue to change over time
- the metadata will likely only get worse over time as upstream deprecates it
Short-term actions
I'm going to add deprecation warnings to the release of Nokogiri that packages libxml2 2.14.0 (not yet released as of this writing) for the particular facets that are already deprecated upstream:
implied_start_tag?deprecated?(how meta)sub_elementsdefault_sub_elementoptional_attributesdeprecated_attributes(how meta)required_attributes
Long-term actions
I'd like to mark the entire class and all its methods as deprecated in a pre-2.0 release, and remove it entirely in a 2.0 release.
Are you surprised by this?
If you are a user of this API, I would really like to talk to you to understand your use case and help make this change easier.