mirror of
https://github.com/flynx/colors.js.git
synced 2025-10-29 11:00:11 +00:00
Merge branch 'master' of https://github.com/streaka/colors.js
This commit is contained in:
commit
dfe6290c88
@ -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