postmanlabs / newman

Newman is a command-line collection runner for Postman
https://www.postman.com
Apache License 2.0
6.88k stars 1.16k forks source link

Feature discussion: Provide 'no escape' option in HTML reporter #1019

Closed majoer closed 7 years ago

majoer commented 7 years ago

The postman application renders HTML in, for instance, the description field of a collection. I feel like the newman html reporter should provide a 'no escape' flag without having to modify the default template.

https://github.com/postmanlabs/newman/blob/develop/lib/reporters/html/template-default.hbs My problem can be solved by using handlebars' tripple stash on the 'content' attribute: {{{collection.description.content}}}

Would it make sense to provide an option to disable html escaping without having to modify the default template? (I am fishing for a maintenance free solution here)

Postman: screenshot from 2017-05-10 10-44-50

Default template: screenshot from 2017-05-10 10-52-31

Custom template: screenshot from 2017-05-10 10-53-50

czardoz commented 7 years ago

@majoer Thanks for reporting this!

This is actually the very reason why we've allowed customizable templates for HTML reporter. There are a really large number of customizations everyone requires, and it usually bloats up the reporter, making it slow & ugly if we try to address all of them. Especially in this particular case, since it's a change to the template itself, the right thing to do is provide a custom template, which works exactly the way you need it :-)

The maintenance free solution for you would be to change the default template, and provide the modified one using the --reporter-html-template <path> option. As a part of our philosophy, we ensure that the data structure provided to the template does not change between releases, because a lot of our users depend on this feature.

If you're still apprehensive about maintenance issues, you can pin to a specific version of Newman, and update only when you need new features/bugfixes :)