You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When wordwrap.Write() encounters a hyphen, it immediately adds the existing space, word, and hyphen, without first checking to see if this would exceed the limit. This can cause the hyphen to extend beyond the limit.
Example: wordwrap.String("foo foo-foobar", 7) should return
If the word-thus-far is exactly at the limit and `wordwrap.Write` sees a hyphen, it writes the word to the buffer *and the hyphen*, exceeding the limit. This change fixes that behavior by instead adding the byphen to the word "as normal", and *then* checking to see if the word will fit within the limit. If it does, only then will it flush the word to the buffer.
Fixmuesli#66
When wordwrap.Write() encounters a hyphen, it immediately adds the existing space, word, and hyphen, without first checking to see if this would exceed the limit. This can cause the hyphen to extend beyond the limit.
Example:
wordwrap.String("foo foo-foobar", 7)
should returnbut actually returns:
The text was updated successfully, but these errors were encountered: