Closed watson closed 5 years ago
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! Checkout the Issuehunt explorer to discover more funded issues. Need some help from other developers? Add your repositories on Issuehunt to raise funds.
stroncium earned $40.00 by resolving this issue!
@issuehunt has funded $40.00 to this issue. See it on IssueHunt
@sindresorhus has rewarded $36.00 to @stroncium. See it on IssueHunt
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: