Register the no-escape escape functionality in handlebars

Before, handlebars automatically applied html escaping, which resulted
in <>'& beeing escaped. But we don't need to escape for terminal output.
This commit is contained in:
Matthias Beyer 2017-09-20 19:12:06 +02:00
parent 4b906f27b1
commit de69d31a58

View file

@ -77,6 +77,8 @@ impl ImagLogger {
pub fn new(matches: &ArgMatches, config: Option<&Configuration>) -> Result<ImagLogger> { pub fn new(matches: &ArgMatches, config: Option<&Configuration>) -> Result<ImagLogger> {
let mut handlebars = Handlebars::new(); let mut handlebars = Handlebars::new();
handlebars.register_escape_fn(::handlebars::no_escape);
handlebars.register_helper("black" , Box::new(self::template_helpers::ColorizeBlackHelper)); handlebars.register_helper("black" , Box::new(self::template_helpers::ColorizeBlackHelper));
handlebars.register_helper("blue" , Box::new(self::template_helpers::ColorizeBlueHelper)); handlebars.register_helper("blue" , Box::new(self::template_helpers::ColorizeBlueHelper));
handlebars.register_helper("cyan" , Box::new(self::template_helpers::ColorizeCyanHelper)); handlebars.register_helper("cyan" , Box::new(self::template_helpers::ColorizeCyanHelper));