mirror of
https://github.com/flynx/colors.js.git
synced 2025-11-01 04:20:12 +00:00
style nits
This commit is contained in:
parent
9aebcadf1b
commit
0a5a26c5e8
@ -105,10 +105,7 @@ function applyStyle() {
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
var newLinesPresent = false;
|
var newLinesPresent = str.indexOf('\n') != -1;
|
||||||
if(str.indexOf('\n') != -1){
|
|
||||||
newLinesPresent = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var nestedStyles = this._styles;
|
var nestedStyles = this._styles;
|
||||||
|
|
||||||
@ -116,7 +113,7 @@ function applyStyle() {
|
|||||||
while (i--) {
|
while (i--) {
|
||||||
var code = ansiStyles[nestedStyles[i]];
|
var code = ansiStyles[nestedStyles[i]];
|
||||||
str = code.open + str.replace(code.closeRe, code.open) + code.close;
|
str = code.open + str.replace(code.closeRe, code.open) + code.close;
|
||||||
if(newLinesPresent){
|
if (newLinesPresent){
|
||||||
str = str.replace(newLineRegex, code.close + '\n' + code.open);
|
str = str.replace(newLineRegex, code.close + '\n' + code.open);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user