diff options
author | Samy Pesse <samypesse@gmail.com> | 2015-09-08 23:57:40 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2015-09-08 23:57:40 +0200 |
commit | aa44a109c6e4ec2814d49e4989d06539aa6dae53 (patch) | |
tree | 899dcf536f7641d2ef2267b17cd1736fa4c86e6a | |
parent | 41e5ca8422357797c698180b3d0798f2b907e4cd (diff) | |
download | gitbook-aa44a109c6e4ec2814d49e4989d06539aa6dae53.zip gitbook-aa44a109c6e4ec2814d49e4989d06539aa6dae53.tar.gz gitbook-aa44a109c6e4ec2814d49e4989d06539aa6dae53.tar.bz2 |
Use position indicator that doesn't conflict with asciidoc
-rw-r--r-- | lib/template.js | 10 | ||||
-rw-r--r-- | test/plugins.js | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/template.js b/lib/template.js index bc3e53e..8014405 100644 --- a/lib/template.js +++ b/lib/template.js @@ -103,16 +103,16 @@ TemplateEngine.prototype.processBlock = function(blk) { return blk.body; } - // Return it as a macro - return "%+%"+blk.id+"%+%"; + // Return it as a position marker + return "@%@"+blk.id+"@%@"; }; -// Replace blocks by body after processing -// This is done to avoid that markdown processer parse the block content +// Replace position markers of blocks by body after processing +// This is done to avoid that markdown/asciidoc processer parse the block content TemplateEngine.prototype.replaceBlocks = function(content) { var that = this; - return content.replace(/\%\+\%([\s\S]+?)\%\+\%/g, function(match, key) { + return content.replace(/\@\%\@([\s\S]+?)\@\%\@/g, function(match, key) { var blk = that.blocks[key]; if (!blk) return match; diff --git a/test/plugins.js b/test/plugins.js index 2309395..d10e0b5 100644 --- a/test/plugins.js +++ b/test/plugins.js @@ -230,7 +230,7 @@ describe('Plugins', function () { it('should correctly process unparsable for asciidoc', function() { return testTpl('.adoc', '{% test %}**hello**{% endtest %}') .then(function(content) { - content.should.equal('<div class="paragraph">\n<p>test**hello**test</p>\n</div>\n'); + content.should.equal('<div class="paragraph">\n<p>test**hello**test</p>\n</div>'); }); }); }); |