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

fix(color-contrast): ignore nodes that don't contain text #1837

Merged
merged 1 commit into from
Oct 11, 2019

Conversation

straker
Copy link
Contributor

@straker straker commented Oct 2, 2019

Ignore nodes of only emoji, nonBMP unicode, and punctuation. Turns out this was a lot easier than I thought since I discovered we had the unicode functions.

Closes issue: #315

Reviewer checks

Required fields, to be filled out by PR reviewer(s)

  • Follows the commit message policy, appropriate for next version
  • Code is reviewed for security

@straker straker requested a review from a team as a code owner October 2, 2019 19:55
Copy link
Contributor

@AutoSponge AutoSponge left a comment

Choose a reason for hiding this comment

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

Do we need a test for   or other whitespace characters that DO take up space but do not have contrast (since they don't print anything)?

&rlm; seems very specialized and is one of the few <control> characters with an HTML entity, are we checking for U+0000 - U+001F, U+007F - U+009F, etc.?

@straker
Copy link
Contributor Author

straker commented Oct 4, 2019

text.sanitize should remove any whitespace characters from the text

@straker straker merged commit 223a4bc into develop Oct 11, 2019
@straker straker deleted the colorContrastNonPrintable branch October 11, 2019 14:35
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.

None yet

3 participants