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

Improve generic attributes tokenization #169

merged 1 commit into from Sep 17, 2017


None yet
1 participant

50Wliu commented Sep 17, 2017


  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

Redo of #94. Non-id attributes are now tokenized similarly to how id is tokenized. The odd character classes are derived from the official HTML 5.1 spec - see inline comments.

Alternate Designs

I did debate getting rid of the special id tokenization and lumping it with the generic attributes, but it seems like it's needed for #48.

The tag name could also be included in the meta tag to facilitate #48. However, I believe it might be better to split class off to its own pattern.


Improved attribute highlighting.

Possible Drawbacks

Since I'm following the spec as closely as possible here, I don't believe there will be any drawbacks. I did not however, include NUL in the character classes.

Applicable Issues

Fixes #89
Fixes #91

@50Wliu 50Wliu merged commit 457b294 into master Sep 17, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed

@50Wliu 50Wliu deleted the wl-attributes branch Sep 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment