Skip to content

fix(color-contrast): ignore format unicode characters#4102

Merged
straker merged 4 commits intodevelopfrom
unicode-format
Jul 26, 2023
Merged

fix(color-contrast): ignore format unicode characters#4102
straker merged 4 commits intodevelopfrom
unicode-format

Conversation

@straker
Copy link
Copy Markdown
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
Copy Markdown
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.

Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
@straker
Copy link
Copy Markdown
Contributor Author

straker commented Jul 26, 2023

Thanks. I do indeed like the idea much better

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