summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-asciidoc/lib/summary.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-02-09 17:50:28 +0100
committerSamy Pessé <samypesse@gmail.com>2016-12-22 11:46:18 +0100
commitd59c9e2be10b807b0d3e4bf16cada0e456fa73e7 (patch)
tree43d22ee6bd46badfda5f43ef17b5c58d975d0ca9 /packages/gitbook-asciidoc/lib/summary.js
parent3530e504ba1714b4179719242ade88d8b89e9081 (diff)
downloadgitbook-d59c9e2be10b807b0d3e4bf16cada0e456fa73e7.zip
gitbook-d59c9e2be10b807b0d3e4bf16cada0e456fa73e7.tar.gz
gitbook-d59c9e2be10b807b0d3e4bf16cada0e456fa73e7.tar.bz2
Add tests for toText methods
Diffstat (limited to 'packages/gitbook-asciidoc/lib/summary.js')
-rwxr-xr-xpackages/gitbook-asciidoc/lib/summary.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/gitbook-asciidoc/lib/summary.js b/packages/gitbook-asciidoc/lib/summary.js
index b36a847..8ba30de 100755
--- a/packages/gitbook-asciidoc/lib/summary.js
+++ b/packages/gitbook-asciidoc/lib/summary.js
@@ -53,8 +53,7 @@ function summaryToText(summary) {
var bl = "\n";
var content = "= Summary"+bl+bl;
- var _base = function(_article) {
- var article = _article.toJSON();
+ var _base = function(article) {
if (article.path) {
return "link:"+article.path+"["+article.title+"]";
} else {
@@ -63,8 +62,8 @@ function summaryToText(summary) {
};
var convertArticle = function(article, d) {
- content = content + Array(d+1).join(".") + " " + _base(article)+bl;
- article.articles.each(function(_article) {
+ content = content + Array(d+2).join(".") + " " + _base(article)+bl;
+ _.each(article.articles, function(_article) {
convertArticle(_article, d + 1);
});
};