Skip to content

Block API: Validation should be case insensitive #18666

@aduth

Description

@aduth

The isEquivalentHTML function currently returns false for the following comparison:

isEquivalentHTML( '<DIV CLASS="foo"></DIV>', '<div class="foo"></div>' );
// false

This should return true, as both the tag name and attribute name should be considered case-insensitive.

References:

Tags contain a tag name, giving the element's name. HTML elements all have names that only use ASCII alphanumerics. In the HTML syntax, tag names, even those for foreign elements, may be written with any mix of lower- and uppercase letters that, when converted to all-lowercase, matches the element's tag name; tag names are case-insensitive.

https://html.spec.whatwg.org/multipage/syntax.html#elements-2

In the HTML syntax, attribute names, even those for foreign elements, may be written with any mix of ASCII lower and ASCII upper alphas. [...] There must never be two or more attributes on the same start tag whose names are an ASCII case-insensitive match for each other.

https://html.spec.whatwg.org/multipage/syntax.html#attributes-2

Metadata

Metadata

Assignees

Labels

Needs DevReady for, and needs developer efforts[Feature] Block APIAPI that allows to express the block paradigm.[Feature] Block Validation/DeprecationHandling block validation to determine accuracy and deprecation[Feature] ParsingRelated to efforts to improving the parsing of a string of data and converting it into a different f[Status] In ProgressTracking issues with work in progress[Type] TaskIssues or PRs that have been broken down into an individual action to take

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions