summaryrefslogtreecommitdiffstats
path: root/lib/template/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/template/index.js')
-rw-r--r--lib/template/index.js7
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