summaryrefslogtreecommitdiffstats
path: root/lib/models
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-05-10 14:36:03 +0200
committerSamy Pessé <samypesse@gmail.com>2016-05-10 14:36:03 +0200
commitb06f1fd6774519a1a901dc63b8e90f13468514a6 (patch)
tree484b0d9a0ebcc7100ffeab055cee8f510e776d99 /lib/models
parent3d8b1880dceba6a51c6a0d724eaffc05244bce44 (diff)
downloadgitbook-b06f1fd6774519a1a901dc63b8e90f13468514a6.zip
gitbook-b06f1fd6774519a1a901dc63b8e90f13468514a6.tar.gz
gitbook-b06f1fd6774519a1a901dc63b8e90f13468514a6.tar.bz2
Fix article.depth starting at 2
Diffstat (limited to 'lib/models')
-rw-r--r--lib/models/summaryArticle.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/models/summaryArticle.js b/lib/models/summaryArticle.js
index da82790..08baac3 100644
--- a/lib/models/summaryArticle.js
+++ b/lib/models/summaryArticle.js
@@ -30,12 +30,13 @@ SummaryArticle.prototype.getArticles = function() {
};
/**
- Return how deep the article is
+ Return how deep the article is.
+ The README has a depth of 1
@return {Number}
*/
SummaryArticle.prototype.getDepth = function() {
- return this.getLevel().split('.').length;
+ return (this.getLevel().split('.').length - 1);
};
/**