summaryrefslogtreecommitdiffstats
path: root/lib/template/blocks.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-26 09:41:26 +0100
committerSamy Pessé <samypesse@gmail.com>2016-02-26 09:41:26 +0100
commitd3d64f636c859f7f01a64f7774cf70bd8ccdc562 (patch)
tree4f7731f37c3a793d187b0ab1cd77680e69534c6c /lib/template/blocks.js
parent4cb9cbb5ae3aa8f9211ffa3ac5e3d34232c0ca4f (diff)
parenteef072693b17526347c37b66078a5059c71caa31 (diff)
downloadgitbook-d3d64f636c859f7f01a64f7774cf70bd8ccdc562.zip
gitbook-d3d64f636c859f7f01a64f7774cf70bd8ccdc562.tar.gz
gitbook-d3d64f636c859f7f01a64f7774cf70bd8ccdc562.tar.bz2
Merge pull request #1109 from GitbookIO/3.0.0
Version 3.0.0
Diffstat (limited to 'lib/template/blocks.js')
-rw-r--r--lib/template/blocks.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/template/blocks.js b/lib/template/blocks.js
new file mode 100644
index 0000000..a079cde
--- /dev/null
+++ b/lib/template/blocks.js
@@ -0,0 +1,16 @@
+var _ = require('lodash');
+
+module.exports = {
+ // Return non-parsed html
+ // since blocks are by default non-parsable, a simple identity method works fine
+ html: _.identity,
+
+ // Highlight a code block
+ // This block can be replaced by plugins
+ code: function(blk) {
+ return {
+ html: false,
+ body: blk.body
+ };
+ }
+};