Skip to content

Commit

Permalink
Use escape instead of noescape in _opts
Browse files Browse the repository at this point in the history
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 hacksalot#219
  • Loading branch information
filipbartek committed Feb 6, 2019
1 parent 567b5af commit 18ab372
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/renderers/handlebars-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/verbs/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 18ab372

Please sign in to comment.