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

Escape search query regex #33

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

tkieft
Copy link

@tkieft tkieft commented Sep 23, 2022

Specifying a query with a regex special character causes ninja-keys to throw an exception. For example, imagine searching a phone number "+13155550000".

To fix, we escape the search query before constructing the regex.

@@ -59,6 +59,7 @@
},
"dependencies": {
"@material/mwc-icon": "0.25.3",
"escape-string-regexp": "5.0.0",

Choose a reason for hiding this comment

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

Adding another library would probably make it a bit slower, is there a way to do this without external libraries?

@KonnorRogers
Copy link

It appears this package hasn't had any comments or any releases in ~2 years. I made a fork with quite a few accessibility improvements and other changes noted in the changelog. Adding this to my package as well.

Fixed in my fork here: KonnorRogers/konnors-ninja-keys#9

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