From 587f8b5036cb1dbb3e003cce0d9af66e019548c0 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 26 Apr 2016 23:17:29 +0700 Subject: [PATCH] also stylize single-quotes and only stylize when they're independent words --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 55464c3..2f3ef30 100644 --- a/index.js +++ b/index.js @@ -43,8 +43,8 @@ module.exports = function (results) { var msg = x.message; // stylize inline code blocks - msg = msg.replace(/`(.*?)`/g, function (m, p1) { - return chalk.bold(p1); + msg = msg.replace(/\B`(.*?)`\B|\B'(.*?)'\B/g, function (m, p1, p2) { + return chalk.bold(p1 || p2); }); var line = String(x.line || 0);