mirror of
https://github.com/flynx/colors.js.git
synced 2025-10-29 11:00:11 +00:00
style nits
This commit is contained in:
parent
9aebcadf1b
commit
0a5a26c5e8
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user