Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

normalize HTML case-insensitive attributes + basic support for custom elements #968

Merged
merged 2 commits into from
Feb 8, 2019

Conversation

rdeltour
Copy link
Member

@rdeltour rdeltour commented Feb 8, 2019

parse boolean/enumerated HTML attributes as case-insensitive

  • add an HTMUtils facility to get whether an HTML attribute has a
    case-insensitive value (boolean and enumerated attributes)
  • pre-process case-insensitive HTML attributes to lower-case their value
  • refactor the pre-processing attribute logic for more clarity
  • add a test

Fix #941

basic schema support for HTML custom elements

  • add an isCustomElement method in HTMLUtils.
  • pre-process custom elements in XMLParser to put them in the
    proprietary namespace used by the Nu Html Checker schemas to treat
    them distinctively.
  • add a simple test case.

Fix #932

- add an `HTMUtils` facility to get whether an HTML attribute has a
  case-insensitive value (boolean and enumerated attributes)
- pre-process case-insensitive HTML attributes to lower-case their value
- refactor the pre-processing attribute logic for more clarity
- add a test

Fix #941
- add an `isCustomElement` method in `HTMLUtils`.
- pre-process custom elements in `XMLParser` to put them in the
  proprietary namespace used by the Nu Html Checker schemas to treat
  them distinctively.
- add a simple test case.

Fix #932
@rdeltour rdeltour added the status: needs review Needs to be reviewed by a team member before further processing label Feb 8, 2019
@rdeltour rdeltour added this to the 4.2.0-beta milestone Feb 8, 2019
@rdeltour rdeltour self-assigned this Feb 8, 2019
Copy link
Member

@mattgarrish mattgarrish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks fine. The only thing I noticed is that custom element names aren't supposed to allow uppercase ascii characters, but this isn't tested. The same is true with the online validators, though.

@rdeltour
Copy link
Member Author

rdeltour commented Feb 8, 2019

The only thing I noticed is that custom element names aren't supposed to allow uppercase ascii characters, but this isn't tested. The same is true with the online validators, though.

Right: I applied the same (naïve) filtering as done in validator.nu. I don't know if they do some more advanced element name validation via Java assertions however.

In any case, this already gives us basic support, and I think we can safely wait for a higher integration with validator.nu to do something more advanced. As Jiminy said, I don't expect people to use custom elements in production anytime soon ;-)

@rdeltour rdeltour merged commit 356fac0 into next/v4.2.0 Feb 8, 2019
@rdeltour rdeltour deleted the fix/html-parsing-normalization branch February 8, 2019 14:40
@rdeltour rdeltour removed the status: needs review Needs to be reviewed by a team member before further processing label Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants