diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-10-21 16:08:24 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-12-22 15:00:49 +0100 |
commit | 6daa1b08f8d0e1ac0059e61f478c28b4e7c9aa04 (patch) | |
tree | 00a83f33f01058927dec08b35add52820b793c03 /packages/gitbook-markdown/test/page.js | |
parent | afe02a463ab4a3e672c8fa128cd4ba17ad4511c7 (diff) | |
download | gitbook-6daa1b08f8d0e1ac0059e61f478c28b4e7c9aa04.zip gitbook-6daa1b08f8d0e1ac0059e61f478c28b4e7c9aa04.tar.gz gitbook-6daa1b08f8d0e1ac0059e61f478c28b4e7c9aa04.tar.bz2 |
Fix #6: don't generate default ID for headings
Diffstat (limited to 'packages/gitbook-markdown/test/page.js')
-rw-r--r-- | packages/gitbook-markdown/test/page.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/gitbook-markdown/test/page.js b/packages/gitbook-markdown/test/page.js index ca3b4ef..8f4b5c5 100644 --- a/packages/gitbook-markdown/test/page.js +++ b/packages/gitbook-markdown/test/page.js @@ -20,6 +20,11 @@ describe('Page parsing', function() { assert(LEXED[0].content); }); + it('should not add id to headings', function() { + assert.equal(page('# Hello').sections[0].content, '<h1>Hello</h1>\n'); + assert.equal(page('# Hello {#test}').sections[0].content, '<h1 id="test">Hello </h1>\n'); + }); + 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 %}"); |