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

Off by one if trimming is disabled #25

Closed
watson opened this issue Dec 29, 2017 · 2 comments · Fixed by #30
Closed

Off by one if trimming is disabled #25

watson opened this issue Dec 29, 2017 · 2 comments · Fixed by #30
Labels
bug 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt help wanted

Comments

@watson
Copy link

watson commented Dec 29, 2017

Issuehunt badges

If trimming is disabled, and you're wrapping a text a say length 3, and there's a whitespace right where the wrap should occur, the whitespace remains and the line break is appended to it. This results in the line being one char too long:

console.log(JSON.stringify(trim('foo bar', 3)))                // => "foo\nbar"
console.log(JSON.stringify(trim('foo bar', 3, {trim: false}))) // => "foo \nbar"

stroncium earned $40.00 by resolving this issue!

@IssueHuntBot
Copy link

@IssueHunt has funded $40.00 to this issue. See it on IssueHunt

stroncium added a commit to stroncium/wrap-ansi that referenced this issue Feb 27, 2019
stroncium added a commit to stroncium/wrap-ansi that referenced this issue Feb 27, 2019
sindresorhus pushed a commit that referenced this issue Mar 3, 2019
Fixes #23
Fixes #24
Fixes #25
Fixes #26
Fixes #27
@IssueHuntBot
Copy link

@sindresorhus has rewarded $36.00 to @stroncium. See it on IssueHunt

  • 💰 Total deposit: $40.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $4.00

@issuehunt-oss issuehunt-oss bot added the 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt label May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants