diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-09-28 00:22:06 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-12-22 15:00:48 +0100 |
commit | b205781abb1f71dc5627b21cfe93e8f4e049191f (patch) | |
tree | fec0591c342ff2a78c88ee9b9e7be863c20fe730 /packages/gitbook-markdown/test | |
parent | 7caa5624e73552be147470fa9b379da55b00b376 (diff) | |
download | gitbook-b205781abb1f71dc5627b21cfe93e8f4e049191f.zip gitbook-b205781abb1f71dc5627b21cfe93e8f4e049191f.tar.gz gitbook-b205781abb1f71dc5627b21cfe93e8f4e049191f.tar.bz2 |
Ignore empty entries in summary
Diffstat (limited to 'packages/gitbook-markdown/test')
-rw-r--r-- | packages/gitbook-markdown/test/fixtures/SUMMARY_EMPTY.md | 5 | ||||
-rw-r--r-- | packages/gitbook-markdown/test/summary.js | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/packages/gitbook-markdown/test/fixtures/SUMMARY_EMPTY.md b/packages/gitbook-markdown/test/fixtures/SUMMARY_EMPTY.md new file mode 100644 index 0000000..3ffacfd --- /dev/null +++ b/packages/gitbook-markdown/test/fixtures/SUMMARY_EMPTY.md @@ -0,0 +1,5 @@ +# Summary + +* [Chapter 1](chapter-1/README.md) +* + diff --git a/packages/gitbook-markdown/test/summary.js b/packages/gitbook-markdown/test/summary.js index 6854bc0..98cd57f 100644 --- a/packages/gitbook-markdown/test/summary.js +++ b/packages/gitbook-markdown/test/summary.js @@ -51,6 +51,11 @@ describe('Summary parsing', function () { assert.equal(l.chapters.length, 5); }); + it('should allow ignore empty entries', function() { + var l = lex('SUMMARY_EMPTY.md'); + assert.equal(l.chapters.length, 1); + }); + it('should correctly convert it to text', function() { var text = summary.toText(LEXED); assertObjectsEqual(summary(text), LEXED); |