jonschlinkert / word-wrap

Wrap words to a specified length.
https://github.com/jonschlinkert
MIT License
193 stars 57 forks source link

duplicated linebreaks when `\n` coincides with the max width position #10

Closed danilosampaio closed 7 years ago

danilosampaio commented 9 years ago

For example:

wrap('asdfg\nqwert', {width:5})

Results:

asdfg

qwert

Instead of:

asdfg
qwert
jonschlinkert commented 9 years ago

marking as a bug. thanks for reporting.

curiousdannii commented 8 years ago

Line breaks get duplicated even when the line breaks aren't at the max width. wrap("aaa\nbbb") becomes " aaa\n\n bbb"

jonschlinkert commented 8 years ago

I just noticed this as well independently, thanks for verifying.