summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/models/templateBlock.js11
-rw-r--r--lib/templating/postRender.js2
2 files changed, 3 insertions, 10 deletions
diff --git a/lib/models/templateBlock.js b/lib/models/templateBlock.js
index 200e048..2f7e19a 100644
--- a/lib/models/templateBlock.js
+++ b/lib/models/templateBlock.js
@@ -23,18 +23,12 @@ var TemplateBlock = Immutable.Record({
// List of shortcuts to replace with this block
shortcuts: Immutable.Map(),
-
- parse: true
}, 'TemplateBlock');
TemplateBlock.prototype.getName = function() {
return this.get('name');
};
-TemplateBlock.prototype.getParse = function() {
- return this.get('parse');
-};
-
TemplateBlock.prototype.getEndTag = function() {
return this.get('end') || ('end' + this.getName());
};
@@ -241,9 +235,8 @@ TemplateBlock.prototype.normalizeBlockResult = function(result) {
@return {String}
*/
TemplateBlock.prototype.blockResultToHtml = function(result, blocksOutput) {
- var parse = this.getParse();
var indexedKey;
- var toIndex = (!parse) || (result.post !== undefined);
+ var toIndex = (!result.parse) || (result.post !== undefined);
if (toIndex) {
indexedKey = genKey();
@@ -251,7 +244,7 @@ TemplateBlock.prototype.blockResultToHtml = function(result, blocksOutput) {
}
// Parsable block, just return it
- if (parse) {
+ if (result.parse) {
return result.body;
}
diff --git a/lib/templating/postRender.js b/lib/templating/postRender.js
index 2662814..ec67696 100644
--- a/lib/templating/postRender.js
+++ b/lib/templating/postRender.js
@@ -36,7 +36,7 @@ function postRender(engine, output) {
var content = output.getContent();
var blocks = output.getBlocks();
- var result = replaceBlocks(content);
+ var result = replaceBlocks(content, blocks);
return Promise.forEach(blocks, function(block) {
var post = block.get('post');