Skip to content

Commit 0c6c9ab

Browse files
houfiotypicode
authored andcommitted
Fix colors not showing (#265)
* Fix colors not showing Also fixes the ` ` on newlines. * Add html escape back Also add proper types to fix type errors
1 parent 617d3b2 commit 0c6c9ab

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-3
lines changed

package-lock.json

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
},
7676
"devDependencies": {
7777
"@types/classnames": "^2.2.3",
78+
"@types/escape-html": "0.0.20",
7879
"@types/react": "^16.0.34",
7980
"@types/react-dom": "^16.0.3",
8081
"@types/react-icons": "^2.2.4",

src/app/formatter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ export function formatLines(str: string): string[] {
1010
return str
1111
.replace(/\n$/, '')
1212
.split('\n')
13+
.map(escapeHTML)
1314
.map(blankLine)
1415
.map(ansi2HTML)
15-
.map(escapeHTML)
1616
}
1717

1818
export function statusTitle(monitor: IMonitor) {

src/app/global.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
declare module 'ansi2html'
2-
declare module 'escape-html'
32
declare module 'lodash.uniqueid'
43
declare module 'react-icons/lib/md/arrow-downward'
54
declare module 'react-icons/lib/md/clear-all'

test/fixtures/verbose/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
setInterval(() => console.log(Math.random()), 100)
1+
setInterval(() => console.log('[31m' + Math.random() + '\n'), 200)

0 commit comments

Comments
 (0)