Skip to content

Commit 8e20782

Browse files
fixed issue of not escaped chars in logs (#24)
1 parent 6cca67d commit 8e20782

File tree

7 files changed

+1231
-1089
lines changed

7 files changed

+1231
-1089
lines changed

CHANGELOG.MD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 0.0.10
2+
- fixed issue of not escaped chars in logs
3+
14
# 0.0.9
25
- fixed issue of not opening features with /%# in names
36

formatter/formatter.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ class HTMLFormatter extends JsonFormatter {
55

66
constructor(options) {
77
super(options);
8-
this.metadata = options.parsedArgvOptions.htmlConfig?.metadata;
8+
this.metadata = options.parsedArgvOptions.htmlConfig?.metadata ?? {};
99
const log = this.log.bind(this);
1010
this.log = function(json) {
1111
const htmlTemplate = fs.readFileSync(path.resolve(__dirname, './index.html'), 'utf-8');
12-
log(htmlTemplate.replace('METADATA', JSON.stringify(this.metadata)).replace('SOURCE_DATA', json));
12+
log(htmlTemplate
13+
.replace('METADATA', JSON.stringify(this.metadata, null, 0))
14+
.replace('SOURCE_DATA', JSON.stringify(JSON.parse(json), null, 0)));
1315
}
1416
}
1517

0 commit comments

Comments
 (0)