yeoman / yosay

Tell Yeoman what to say
BSD 2-Clause "Simplified" License
205 stars 43 forks source link

Handle new line properly #20

Closed danilosampaio closed 9 years ago

danilosampaio commented 9 years ago

When a \n is inserted immediately before/after the maxLength position, it results in a empty string element in the message array, so that the following check fails:

if (!array[index + 1]) {

This bug causes the broken frame reported in the issue #9.

The following if statement works well:

if (index === array.length - 1) {

Fixes #9.

sindresorhus commented 9 years ago

Yay, thanks! :)