summaryrefslogtreecommitdiffstats
path: root/lib/template.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-29 18:16:23 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-29 18:16:23 +0100
commit5fc0c6b507cdeadca710ce3810a886b2eaed52e9 (patch)
tree2d31f77b0d8ea03e346b2299adf9b0693555794e /lib/template.js
parentc8e72092c707d69799c1ccf99ed101970482880b (diff)
downloadgitbook-5fc0c6b507cdeadca710ce3810a886b2eaed52e9.zip
gitbook-5fc0c6b507cdeadca710ce3810a886b2eaed52e9.tar.gz
gitbook-5fc0c6b507cdeadca710ce3810a886b2eaed52e9.tar.bz2
Convert inline svg as png if needed
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) {