Skip to content

Commit bad52bd

Browse files
author
pooya parsa
committedMay 26, 2019
fix: correctly calculate line width when using grave accent
1 parent 07d8246 commit bad52bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

Diff for: ‎src/reporters/fancy.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ export default class FancyReporter extends BasicReporter {
6565

6666
const tag = logObj.tag ? secondaryColor(logObj.tag) : ''
6767

68+
const formattedMessage = message.replace(/`([^`]+)`/g, (_, m) => chalk.cyan(m))
69+
6870
let line
69-
const left = this.filterAndJoin([type, message])
71+
const left = this.filterAndJoin([type, formattedMessage])
7072
const right = this.filterAndJoin([tag, date])
7173
const space = width - stringWidth(left) - stringWidth(right) - 2
7274

@@ -78,8 +80,6 @@ export default class FancyReporter extends BasicReporter {
7880

7981
line += additional.length ? '\n' + additional.join('\n') : ''
8082

81-
line = line.replace(/`([^`]+)`/g, (_, m) => chalk.cyan(m))
82-
8383
return isBadge ? '\n' + line + '\n' : line
8484
}
8585
}

0 commit comments

Comments
 (0)
Please sign in to comment.