Permalink
Browse files

optional flags cannot be unset

  • Loading branch information...
1 parent 404a061 commit e6a7f33e6e7b4409ec04334de7d6195a70fca928 @donpark committed Sep 22, 2016
Showing with 13 additions and 11 deletions.
  1. +4 −4 lib/html2jade.coffee
  2. +9 −7 lib/html2jade.js
@@ -431,10 +431,10 @@ scope.Converter = Converter
scope.Writer = Writer
applyOptions = (options) ->
- entOptions.useNamedReferences = !options.numeric
- nspaces = options.nspaces if options.nspaces
- useTabs = true if options.tabs
- doNotEncode = true if options.donotencode
+ entOptions.useNamedReferences = !options.numeric if options.numeric?
+ nspaces = parseInt(options.nspaces) if options.nspaces?
+ useTabs = !!options.tabs if options.tabs?
+ doNotEncode = !!options.donotencode if options.donotencode?
# node.js classes
if exports?
View
@@ -665,15 +665,17 @@
scope.Writer = Writer;
applyOptions = function(options) {
- entOptions.useNamedReferences = !options.numeric;
- if (options.nspaces) {
- nspaces = options.nspaces;
+ if (options.numeric != null) {
+ entOptions.useNamedReferences = !options.numeric;
}
- if (options.tabs) {
- useTabs = true;
+ if (options.nspaces != null) {
+ nspaces = parseInt(options.nspaces);
}
- if (options.donotencode) {
- return doNotEncode = true;
+ if (options.tabs != null) {
+ useTabs = !!options.tabs;
+ }
+ if (options.donotencode != null) {
+ return doNotEncode = !!options.donotencode;
}
};

0 comments on commit e6a7f33

Please sign in to comment.