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

change(web): add auto-correct filter that requires letter in initial position #12877

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

Conversation

jahorton
Copy link
Contributor

@jahorton jahorton commented Jan 13, 2025

Addresses one item from the auto-correct initial feedback issue (#12648):

Numbers get autocorrected, e.g. 23 -> 2nd.

This is accomplished by adding a new 'filter' function to the auto-correct logic: correctionValidForAutoSelect. A relatively simple guideline, at least for numbers, seems simple enough to define. We can use the standard programming rule for identifiers - starting with a letter. That is, if a token starts with a non-letter, we probably shouldn't do auto-correction with it.

We may need to refine and polish it once auto-correct is out and we are made aware of tricky cases with different character classes, but this should be a good starting point for any such logic.

I've also added a unit-test to validate that the motivating case no longer triggers auto-correction.

@keymanapp-test-bot skip

@jahorton jahorton requested a review from mcdurdin as a code owner January 13, 2025 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant