diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-03-09 10:43:12 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-03-09 10:43:12 +0100 |
commit | 34fc2831e0cf0fed01c71cec28d93472d87f455b (patch) | |
tree | a803cc907c20491ba02863b5d3dd5aedf6bfed10 /test/plugins/blocks/index.js | |
parent | e1594cde2c32e4ff48f6c4eff3d3d461743d74e1 (diff) | |
parent | 1bf68a5aa0703b5a1815cfe4ebb731b5fb6ed9d2 (diff) | |
download | gitbook-34fc2831e0cf0fed01c71cec28d93472d87f455b.zip gitbook-34fc2831e0cf0fed01c71cec28d93472d87f455b.tar.gz gitbook-34fc2831e0cf0fed01c71cec28d93472d87f455b.tar.bz2 |
Merge branch 'version/2.0'
Diffstat (limited to 'test/plugins/blocks/index.js')
-rw-r--r-- | test/plugins/blocks/index.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/plugins/blocks/index.js b/test/plugins/blocks/index.js new file mode 100644 index 0000000..0a02ff7 --- /dev/null +++ b/test/plugins/blocks/index.js @@ -0,0 +1,41 @@ +var assert = require("assert"); + +module.exports = { + blocks: { + "test": { + shortcuts: { + parsers: ["markdown"], + start: "$$", + end: "$$" + }, + process: function(blk) { + return "test"+blk.body+"test"; + } + }, + "test2": { + end: "endtest2end", + process: function(blk) { + return "test2"+blk.body+"test2"; + } + }, + "test3join": { + blocks: [ + "also" + ], + process: function(blk) { + return [blk.body, blk.blocks[0].body].join(blk.kwargs.separator); + } + }, + "test4join": { + blocks: [ + "also", "finally" + ], + process: function(blk) { + assert(blk.blocks.length, 2); + assert(blk.blocks[0].name, "also"); + assert(blk.blocks[1].name, "finally"); + return [blk.body, blk.blocks[0].body, blk.blocks[1].body].join(blk.kwargs.separator); + } + } + } +};
\ No newline at end of file |