Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 0.0.10
- fixed issue of not escaped chars in logs

# 0.0.9
- fixed issue of not opening features with /%# in names

Expand Down
6 changes: 4 additions & 2 deletions formatter/formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ class HTMLFormatter extends JsonFormatter {

constructor(options) {
super(options);
this.metadata = options.parsedArgvOptions.htmlConfig?.metadata;
this.metadata = options.parsedArgvOptions.htmlConfig?.metadata ?? {};
const log = this.log.bind(this);
this.log = function(json) {
const htmlTemplate = fs.readFileSync(path.resolve(__dirname, './index.html'), 'utf-8');
log(htmlTemplate.replace('METADATA', JSON.stringify(this.metadata)).replace('SOURCE_DATA', json));
log(htmlTemplate
.replace('METADATA', JSON.stringify(this.metadata, null, 0))
.replace('SOURCE_DATA', JSON.stringify(JSON.parse(json), null, 0)));
}
}

Expand Down
Loading