diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-05-10 14:36:03 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-05-10 14:36:03 +0200 |
commit | b06f1fd6774519a1a901dc63b8e90f13468514a6 (patch) | |
tree | 484b0d9a0ebcc7100ffeab055cee8f510e776d99 /lib/models/summaryArticle.js | |
parent | 3d8b1880dceba6a51c6a0d724eaffc05244bce44 (diff) | |
download | gitbook-b06f1fd6774519a1a901dc63b8e90f13468514a6.zip gitbook-b06f1fd6774519a1a901dc63b8e90f13468514a6.tar.gz gitbook-b06f1fd6774519a1a901dc63b8e90f13468514a6.tar.bz2 |
Fix article.depth starting at 2
Diffstat (limited to 'lib/models/summaryArticle.js')
-rw-r--r-- | lib/models/summaryArticle.js | 5 |
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); }; /** |