mirror of
https://github.com/flynx/colors.js.git
synced 2025-10-29 11:00:11 +00:00
Preserve multiple consecutive newlines when applying style (closes #231)
This commit is contained in:
parent
fa147da91b
commit
7aa37ffe71
@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user