summaryrefslogtreecommitdiffstats
path: root/lib/parse/summary.js
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@friendco.de>2014-03-31 16:21:04 -0700
committerAaron O'Mullan <aaron.omullan@friendco.de>2014-03-31 17:06:39 -0700
commit3f3bade58e3b258aadab8ecf084004d06e62cede (patch)
tree9f2d47b9032368b0affb94320c922b7bb6041fe5 /lib/parse/summary.js
parent0821b10e18d011da6fcbb22631170f7a46e819f4 (diff)
downloadgitbook-3f3bade58e3b258aadab8ecf084004d06e62cede.zip
gitbook-3f3bade58e3b258aadab8ecf084004d06e62cede.tar.gz
gitbook-3f3bade58e3b258aadab8ecf084004d06e62cede.tar.bz2
Change summary data format
Simplify chapter objects, by making them identical to article objects besides the .articles attribute
Diffstat (limited to 'lib/parse/summary.js')
-rw-r--r--lib/parse/summary.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/parse/summary.js b/lib/parse/summary.js
index f021401..1237b37 100644
--- a/lib/parse/summary.js
+++ b/lib/parse/summary.js
@@ -90,10 +90,9 @@ function parseArticle(nodes) {
}
function parseChapter(nodes) {
- return {
- chapter: parseTitle(_.first(nodes).text),
+ return _.extend(parseTitle(_.first(nodes).text), {
articles: _.map(listSplit(filterList(nodes), 'list_item_start', 'list_item_end'), parseArticle)
- };
+ });
}
function parseSummary(src) {