summaryrefslogtreecommitdiffstats
path: root/lib/template.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/template.js')
-rw-r--r--lib/template.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/template.js b/lib/template.js
index f142763..e30074d 100644
--- a/lib/template.js
+++ b/lib/template.js
@@ -75,6 +75,11 @@ var TemplateEngine = function(book) {
// Bind methods
_.bindAll(this);
+
+ // Default block "html" that return html not parsed
+ this.addBlock("html", {
+ process: _.identity
+ });
};
// Process a block in a context
@@ -291,7 +296,7 @@ TemplateEngine.prototype.addBlock = function(name, block) {
TemplateEngine.prototype._applyShortcut = function(parser, content, shortcut) {
if (!_.contains(shortcut.parsers, parser)) return content;
var regex = new RegExp(
- stringUtils.escapeRegex(shortcut.start) + "\\s*([\\s\\S]*?[^\\$])\\s*" + stringUtils.escapeRegex(shortcut.end),
+ stringUtils.escapeRegex(shortcut.start) + "([\\s\\S]*?[^\\$])" + stringUtils.escapeRegex(shortcut.end),
'g'
);
return content.replace(regex, function(all, match) {