From de69d31a588642cb4a8f0fb66c0dffaaadaa0022 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 20 Sep 2017 19:12:06 +0200 Subject: [PATCH] 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. --- lib/core/libimagrt/src/logger.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/core/libimagrt/src/logger.rs b/lib/core/libimagrt/src/logger.rs index 8a50d90d..46086cfd 100644 --- a/lib/core/libimagrt/src/logger.rs +++ b/lib/core/libimagrt/src/logger.rs @@ -77,6 +77,8 @@ impl ImagLogger { pub fn new(matches: &ArgMatches, config: Option<&Configuration>) -> Result { 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("blue" , Box::new(self::template_helpers::ColorizeBlueHelper)); handlebars.register_helper("cyan" , Box::new(self::template_helpers::ColorizeCyanHelper));