Close #92 PR: Closing before and reopening the style after a line break.
This commit is contained in:
parent
139f8b68cc
commit
05f87e25e1
2 changed files with 9 additions and 0 deletions
5
index.js
5
index.js
|
|
@ -79,6 +79,11 @@ function applyStyle() {
|
|||
// otherwise only the part of the string until said closing code
|
||||
// will be colored, and the rest will simply be 'plain'.
|
||||
str = code.open + str.replace(code.closeRe, code.open) + code.close;
|
||||
|
||||
// Close the coloring before a line break and reopening after next line
|
||||
// To fix a bleed issue on macs
|
||||
// see https://github.com/chalk/chalk/pull/92
|
||||
str = str.replace(/\n/gm, code.close + '\n' + code.open);
|
||||
}
|
||||
|
||||
// Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue