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 format unicode characters #4102

Merged
merged 4 commits into from Jul 26, 2023
Merged

Conversation

straker
Copy link
Contributor

@straker straker commented Jul 24, 2023

Format characters such as zero-width spaces were not checked in the nonBMP section of the unicode functions. I generated the regex by using regenerate and adding all format unicode to it.

In making this change I also discovered a bug in hasUnicode in that it only checked the first option that matched and not all options due to the early return style. So trying to check if a string contained punctuation while also checking if it had emoji would only ever check if it had emoji. Fixed that while I was here.

Closes: #3913

@straker straker requested a review from a team as a code owner July 24, 2023 21:32
WilcoFiers
WilcoFiers previously approved these changes Jul 26, 2023
Copy link
Contributor

@WilcoFiers WilcoFiers left a comment

Choose a reason for hiding this comment

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

I'm okay with this approach, but had an idea you might appreciate.

test/commons/text/unicode.js Outdated Show resolved Hide resolved
test/commons/text/unicode.js Outdated Show resolved Hide resolved
test/commons/text/unicode.js Outdated Show resolved Hide resolved
Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
@straker
Copy link
Contributor Author

straker commented Jul 26, 2023

Thanks. I do indeed like the idea much better

@straker straker merged commit 049522e into develop Jul 26, 2023
17 checks passed
@straker straker deleted the unicode-format branch July 26, 2023 16:55
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.

isIconLigature fails on leading invisible character
2 participants