From 18ab3724da07f0b4e2e1be45bc94b305d1899a31 Mon Sep 17 00:00:00 2001 From: Filip Bartek Date: Wed, 6 Feb 2019 13:48:16 +0100 Subject: [PATCH] Use `escape` instead of `noescape` in `_opts` Make the escaping option similar to `prettify` in `_opts` by making it positive. The `_opts` option `prettify` is exposed in CLI as --no-prettify, similarly to `escape` exposed as --no-escape. Refactor. Corollary of #219 --- src/renderers/handlebars-generator.js | 2 +- src/verbs/build.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderers/handlebars-generator.js b/src/renderers/handlebars-generator.js index f928d3f8..765c2b43 100644 --- a/src/renderers/handlebars-generator.js +++ b/src/renderers/handlebars-generator.js @@ -38,7 +38,7 @@ module.exports = { template = HANDLEBARS.compile(tpl, { strict: false, assumeObjects: false, - noEscape: data.opts.noescape + noEscape: !data.opts.escape } ); return template(data); diff --git a/src/verbs/build.js b/src/verbs/build.js index f7907ae8..854fbf7a 100644 --- a/src/verbs/build.js +++ b/src/verbs/build.js @@ -194,7 +194,7 @@ var _prep = function( src, dst, opts ) { _opts.theme = (opts.theme && opts.theme.toLowerCase().trim()) || 'modern'; _opts.prettify = opts.prettify === true; _opts.private = opts.private === true; - _opts.noescape = opts.escape === false; + _opts.escape = opts.escape === true; _opts.css = opts.css; _opts.pdf = opts.pdf; _opts.wrap = opts.wrap || 60;