summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-21 10:56:44 +0100
committerSamy Pessé <samypesse@gmail.com>2016-12-22 11:46:14 +0100
commit0323d17ab937b0e223e92d3166765052e896fa5b (patch)
tree3e82afcdeb5105d0c2ec0291c6ffaea59b5e7500
parent7e21dbde1409471590c86c01196f596aa7e5d80f (diff)
downloadgitbook-0323d17ab937b0e223e92d3166765052e896fa5b.zip
gitbook-0323d17ab937b0e223e92d3166765052e896fa5b.tar.gz
gitbook-0323d17ab937b0e223e92d3166765052e896fa5b.tar.bz2
Fix langs parsing
-rwxr-xr-xpackages/gitbook-asciidoc/lib/summary.js11
-rwxr-xr-xpackages/gitbook-asciidoc/test/fixtures/LANGS.adoc2
2 files changed, 7 insertions, 6 deletions
diff --git a/packages/gitbook-asciidoc/lib/summary.js b/packages/gitbook-asciidoc/lib/summary.js
index 17c9834..b4f9780 100755
--- a/packages/gitbook-asciidoc/lib/summary.js
+++ b/packages/gitbook-asciidoc/lib/summary.js
@@ -64,10 +64,7 @@ function parseChaptersLevel(chapterList, level, base) {
function parseSummary(src, entryPoint) {
entryPoint = entryPoint || "README.adoc";
- var html = convert(src);
- $ = cheerio.load(html);
-
- var chapters = parseList($("ol").first(), $);
+ var chapters = parseEntries(src);
chapters = defaultChapterList(chapters, entryPoint);
chapters = parseChaptersLevel(chapters);
@@ -77,7 +74,11 @@ function parseSummary(src, entryPoint) {
}
function parseEntries (src) {
- return [];
+ var html = convert(src);
+ $ = cheerio.load(html);
+
+ var chapters = parseList($("ol").first(), $);
+ return chapters;
}
diff --git a/packages/gitbook-asciidoc/test/fixtures/LANGS.adoc b/packages/gitbook-asciidoc/test/fixtures/LANGS.adoc
index 8ea9e11..d71a435 100755
--- a/packages/gitbook-asciidoc/test/fixtures/LANGS.adoc
+++ b/packages/gitbook-asciidoc/test/fixtures/LANGS.adoc
@@ -1,4 +1,4 @@
= Languages
. link:en/[English]
-. link:en/[French]
+. link:fr/[French]