This commit is contained in:
Josh Pike 2018-04-26 15:54:24 +07:00
commit dfe6290c88

View File

@ -105,10 +105,7 @@ function applyStyle() {
return str;
}
var newLinesPresent = false;
if(str.indexOf('\n') != -1){
newLinesPresent = true;
}
var newLinesPresent = str.indexOf('\n') != -1;
var nestedStyles = this._styles;
@ -116,7 +113,7 @@ function applyStyle() {
while (i--) {
var code = ansiStyles[nestedStyles[i]];
str = code.open + str.replace(code.closeRe, code.open) + code.close;
if(newLinesPresent){
if (newLinesPresent){
str = str.replace(newLineRegex, code.close + '\n' + code.open);
}
}