From e9e94a7344bf25b4c2aa6eb9cb2ce5d93dda583b Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Mon, 31 Mar 2014 15:14:31 -0700 Subject: [PATCH] Filter out empty sections when generating pages --- lib/parse/page.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/parse/page.js b/lib/parse/page.js index 6481e656e..515f4bb3f 100644 --- a/lib/parse/page.js +++ b/lib/parse/page.js @@ -55,6 +55,9 @@ function parsePage(src) { section.type = sectionType(section, idx); return section; }) + .filter(function(section) { + return !_.isEmpty(section); + }) .map(function(section) { // Generate a uniqueId to identify this section in our code var id = _.uniqueId('gitbook_');