Skip to content

Work around word breaking issue #819

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

Merged
merged 1 commit into from
Jul 3, 2025
Merged

Work around word breaking issue #819

merged 1 commit into from
Jul 3, 2025

Conversation

natecook1000
Copy link
Member

Given a particular input string and index, the _wordIndex(after:) method can erroneously return an index before its parameter. This change handles that case correctly, by detecting when we're updating the word break cache with a previously cached index.

Fixes #818.

Given a particular input string and index, the _wordIndex(after:)
method can erroneously return an index before its parameter.
This change handles that case correctly, by detecting when we're
updating the word break cache with a previously cached index.
@natecook1000
Copy link
Member Author

@swift-ci Please test

@stephentyrone stephentyrone merged commit c7c539d into main Jul 3, 2025
3 checks passed
@stephentyrone stephentyrone deleted the word-breaking-818 branch July 3, 2025 17:08
natecook1000 pushed a commit that referenced this pull request Jul 3, 2025
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.

Regex seems to result in an infinite loop when looking for Anchor.wordBoundary.
2 participants