diff --git a/lib/nodejs/swagger-to-md/core.js b/lib/nodejs/swagger-to-md/core.js index 418af61..eca33cf 100644 --- a/lib/nodejs/swagger-to-md/core.js +++ b/lib/nodejs/swagger-to-md/core.js @@ -204,7 +204,8 @@ class Modules { const render = this.options.render; const include_module = this.includeModule; return this.layoutModules.reduce((prev, mod) => { - const locals = mod.controller(Object.assign({}, ctx, { include_module })); + const locals = mod.controller(Object.assign({}, ctx)); + locals.include_module = include_module; return prev.then(() => { return render(mod.template, locals) .then((output) => { @@ -230,7 +231,9 @@ class Modules { if (!mod) { return ''; } - const locals = mod.controller(Object.assign({}, ctx, mctx, { include_module })); + const locals = mod.controller(Object.assign({}, ctx, mctx)); + locals.include_module = include_module; + const string = fs.readFileSync(mod.template, 'utf8'); return renderString(string, locals);