summaryrefslogtreecommitdiffstats
path: root/lib/parse
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-04-04 09:47:06 -0700
committerSamy Pessé <samypesse@gmail.com>2014-04-04 09:47:06 -0700
commita52a4bed1a01f954d6faa06b502f5fe311790cb5 (patch)
tree94f9f2ca2e15cfa5d71dda5d6546dbdbffe94d62 /lib/parse
parent9dce855113b9217201cbf1cac851da44d3238fd4 (diff)
downloadgitbook-a52a4bed1a01f954d6faa06b502f5fe311790cb5.zip
gitbook-a52a4bed1a01f954d6faa06b502f5fe311790cb5.tar.gz
gitbook-a52a4bed1a01f954d6faa06b502f5fe311790cb5.tar.bz2
Change normalization of parser to give link in .md
Diffstat (limited to 'lib/parse')
-rw-r--r--lib/parse/navigation.js6
-rw-r--r--lib/parse/summary.js5
2 files changed, 4 insertions, 7 deletions
diff --git a/lib/parse/navigation.js b/lib/parse/navigation.js
index 145c873..aeb2716 100644
--- a/lib/parse/navigation.js
+++ b/lib/parse/navigation.js
@@ -9,7 +9,7 @@ function clean(obj) {
// Returns from a summary a map of
/*
{
- "file/path.html": {
+ "file/path.md": {
prev: ...,
next: ...,
},
@@ -25,7 +25,7 @@ function navigation(summary, files) {
// Special README nav
var README_NAV = {
- path: 'README.html',
+ path: 'README.md',
title: 'Introduction',
};
@@ -69,7 +69,7 @@ function navigation(summary, files) {
});
// Hack for README.html
- mapping['README.html'] = {
+ mapping['README.md'] = {
title: README_NAV.title,
prev: null,
next: clean(summary.chapters[0]),
diff --git a/lib/parse/summary.js b/lib/parse/summary.js
index 0995c40..7725b59 100644
--- a/lib/parse/summary.js
+++ b/lib/parse/summary.js
@@ -82,10 +82,7 @@ function parseTitle(src, nums) {
level: level,
// Replace .md references with .html
- path: matches[2].replace(/\.md$/, '.html'),
-
- // Original, non normalized path
- _path: matches[2],
+ path: matches[2],
};
}