diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-03-07 14:11:11 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-12-22 15:00:37 +0100 |
commit | 2516137d4e2b59b728f8562edb0e4c929aa6c5f8 (patch) | |
tree | 46fd9d11af80aa4036d684ad79419cdbfd40a5e6 /packages/gitbook-markdown/test/page.js | |
parent | aca50f4d1eea75c5035ae6451294a9c01d637880 (diff) | |
download | gitbook-2516137d4e2b59b728f8562edb0e4c929aa6c5f8.zip gitbook-2516137d4e2b59b728f8562edb0e4c929aa6c5f8.tar.gz gitbook-2516137d4e2b59b728f8562edb0e4c929aa6c5f8.tar.bz2 |
Fix code fences escaping (add more tests)
Diffstat (limited to 'packages/gitbook-markdown/test/page.js')
-rw-r--r-- | packages/gitbook-markdown/test/page.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/gitbook-markdown/test/page.js b/packages/gitbook-markdown/test/page.js index 8486435..67c209d 100644 --- a/packages/gitbook-markdown/test/page.js +++ b/packages/gitbook-markdown/test/page.js @@ -20,8 +20,14 @@ describe('Page parsing', function() { assert(LEXED[0].content); }); - it('should escape codeblocks in preparation', function() { + it('should escape codeblocks in preparation (1)', function() { assert.equal(page.prepare("Hello `world`"), "Hello {% raw %}`world`{% endraw %}"); + assert.equal(page.prepare("Hello `world test`"), "Hello {% raw %}`world test`{% endraw %}"); + assert.equal(page.prepare("Hello ```world test```"), "Hello {% raw %}```world test```{% endraw %}"); + assert.equal(page.prepare("Hello\n```js\nworld test\n```\n"), "Hello\n{% raw %}```js\nworld test\n```{% endraw %}\n"); + }); + + it('should escape codeblocks in preparation (2)', function() { assert.equal( page.prepare("Hello\n\n\n\tworld\n\thello\n\n\ntest"), "Hello\n{% raw %}\n\n\tworld\n\thello\n\n\n{% endraw %}test" |