gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

ComboboxControl: Normalize hyphen-like unicode characters to ASCII hyphens when matching search queries

Open markbiek opened this issue 2 years ago • 1 comments

What?

When searching, treat hyphen-like characters as an ASCII hyphen (%2D).

Why?

This is the implementation agreed upon in discussions on #41952. This improves the search but doesn't affect search result highlighting or cause any other accessibility regressions.

How?

Following the example outlined by @ciampo , we have a list of hyphen-like characters that are replaced with an ASCII - when looking for search matches.

Testing Instructions

Run

npm run test-unit ./packages/components/src/utils/test/strings.js

to verify string normalization is functioning properly.

Screenshots or screencast

image

image

markbiek avatar Aug 03 '22 15:08 markbiek

:wave: Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @markbiek! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

github-actions[bot] avatar Aug 03 '22 15:08 github-actions[bot]

Congratulations on your first merged pull request, @markbiek! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts:

https://profiles.wordpress.org/me/profile/edit/

And if you don't have a WordPress.org account, you can create one on this page:

https://login.wordpress.org/register

Kudos!

github-actions[bot] avatar Aug 15 '22 06:08 github-actions[bot]