From 18c64ad7ba85bae41dd6226207fff8a329554826 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Sun, 17 Jan 2016 12:38:10 +0100 Subject: [PATCH] cleanup #92 --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index b7e3b10..c043357 100644 --- a/index.js +++ b/index.js @@ -80,10 +80,10 @@ function applyStyle() { // 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); + // Close the styling before a linebreak and reopen + // after next line to fix a bleed issue on OS X + // https://github.com/chalk/chalk/pull/92 + str = str.replace(/\r?\n/g, code.close + '$&' + code.open); } // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue.