Skip to content

Commit

Permalink
Preserve multiple consecutive newlines when applying style (closes #231)
Browse files Browse the repository at this point in the history
  • Loading branch information
DABH committed Jun 25, 2018
1 parent fa147da commit 7aa37ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ function applyStyle() {
var code = ansiStyles[nestedStyles[i]];
str = code.open + str.replace(code.closeRe, code.open) + code.close;
if (newLinesPresent) {
str = str.replace(newLineRegex, code.close + '\n' + code.open);
str = str.replace(newLineRegex, function(match) {
return code.close + match + code.open;
});
}
}

Expand Down

0 comments on commit 7aa37ff

Please sign in to comment.