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

Respect non-breaking spaces #39

Closed
mgeisler opened this issue Apr 19, 2017 · 0 comments
Closed

Respect non-breaking spaces #39

mgeisler opened this issue Apr 19, 2017 · 0 comments
Assignees
Labels

Comments

@mgeisler
Copy link
Owner

According to the comment on #28, we treat non-breaking spaces as normal whitespace and break on it. We should probably not do that :-)

@mgeisler mgeisler added the bug label Apr 19, 2017
@mgeisler mgeisler self-assigned this Apr 22, 2017
mgeisler added a commit that referenced this issue May 4, 2017
Non-breaking spaces are (obviously) treated as whitespace characters
by the String::split_whitespace method, which meant that we would
happily break words on such spaces. We now use String::split instead
with our own predicate.

Somewhat surprisingly, using String::split is about 15-20% faster than
using String::split_whitespace, so we even get a performance boost out
of this new code.

Fixes #39.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant