diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-11 11:53:32 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-11 11:53:32 +0100 |
commit | 02cff8c72ca742cd06a65d171657eb230eedbc5b (patch) | |
tree | a56125291f2fbb8a54d3e68210818133e53701fd /lib/template | |
parent | a67993ac0b08665502c67d9852124d17d66f4072 (diff) | |
download | gitbook-02cff8c72ca742cd06a65d171657eb230eedbc5b.zip gitbook-02cff8c72ca742cd06a65d171657eb230eedbc5b.tar.gz gitbook-02cff8c72ca742cd06a65d171657eb230eedbc5b.tar.bz2 |
Add base for page parsing
Diffstat (limited to 'lib/template')
-rw-r--r-- | lib/template/index.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/template/index.js b/lib/template/index.js index cd2735f..833ff76 100644 --- a/lib/template/index.js +++ b/lib/template/index.js @@ -292,8 +292,7 @@ TemplateEngine.prototype.applyBlock = function(name, blk, ctx) { // Render a string TemplateEngine.prototype.renderString = function(content, context, options) { options = _.defaults(options || {}, { - path: null, - type: null + path: null }); // Setup context for the template @@ -315,9 +314,9 @@ TemplateEngine.prototype.renderString = function(content, context, options) { if (options.path) { options.path = this.book.resolve(options.path); } - if (!options.type && options.path) { + if (!context.type && options.path) { var parser = parsers.get(path.extname(options.path)); - options.type = parser? parser.name : null; + context.type = parser? parser.name : null; } // Replace shortcuts |