You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When doing an analysis of WordPress themes, I got validation errors being reported for these attributes:
html@xml:lang
html@xmlns
These are included in many WordPress themes because WordPress to strive to be valid XHTML. WordPress has since moved to HTML5, and HTML5 specifies that the http://www.w3.org/1999/xhtml namespace is implied.
Since the Document class normalizes HTML documents as HTML5 with the HTML5 doctype, I think it makes sense to also have Document::loadHTML() automatically normalize these attributes.
We should consider normalizing xml:lang to just lang, or removing xml:lang if the lang attribute is already there. The xmlns attribute here is redundant and unnecessary; it can simply be removed.
Feature description
When doing an analysis of WordPress themes, I got validation errors being reported for these attributes:
html@xml:lang
html@xmlns
These are included in many WordPress themes because WordPress to strive to be valid XHTML. WordPress has since moved to HTML5, and HTML5 specifies that the
http://www.w3.org/1999/xhtml
namespace is implied.Since the
Document
class normalizes HTML documents as HTML5 with the HTML5 doctype, I think it makes sense to also haveDocument::loadHTML()
automatically normalize these attributes.We should consider normalizing
xml:lang
to justlang
, or removingxml:lang
if thelang
attribute is already there. Thexmlns
attribute here is redundant and unnecessary; it can simply be removed.So given:
Should be normalized to just:
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: