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

Fix crash for long lines without spaces #341

Merged
merged 1 commit into from
Dec 10, 2024
Merged

Fix crash for long lines without spaces #341

merged 1 commit into from
Dec 10, 2024

Conversation

bjorkert
Copy link
Contributor

@bjorkert bjorkert commented Dec 9, 2024

Fix a crash that occurred when wrapping very long words by ensuring the substring length is never negative. This change adjusts the calculation of availableSpace and adds checks to prevent out-of-bound string indexing, stabilizing text wrapping behavior.

@bjorkert bjorkert requested a review from marionbarker December 9, 2024 18:58
Copy link
Collaborator

@marionbarker marionbarker left a comment

Choose a reason for hiding this comment

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

Tested using a site which had a "problem" note. This PR fixes it.
Code review looks good.

@marionbarker marionbarker merged commit 97113d1 into dev Dec 10, 2024
@marionbarker marionbarker deleted the line-wrap-bug branch December 13, 2024 21:12
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.

2 participants