summaryrefslogtreecommitdiffstats
path: root/lib/models
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-05-08 22:33:41 +0200
committerSamy Pesse <samypesse@gmail.com>2016-05-08 22:33:41 +0200
commit3d0054dd643a813aa10ace89920a5c910048a232 (patch)
tree2ff648fe5cc1e03f017cc423606e0cfeba27aaad /lib/models
parent13bc89ff4490abb9ea6ea6bd98bf86a9ad08325b (diff)
downloadgitbook-3d0054dd643a813aa10ace89920a5c910048a232.zip
gitbook-3d0054dd643a813aa10ace89920a5c910048a232.tar.gz
gitbook-3d0054dd643a813aa10ace89920a5c910048a232.tar.bz2
Fix #1286: by default blocks should not be parsable
Diffstat (limited to 'lib/models')
-rw-r--r--lib/models/templateBlock.js11
1 files changed, 2 insertions, 9 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;
}