summaryrefslogtreecommitdiffstats
path: root/lib/parse/summary.js
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@friendco.de>2014-03-31 12:00:13 -0700
committerAaron O'Mullan <aaron.omullan@friendco.de>2014-03-31 12:00:13 -0700
commit1d321207b045f7f9c34267fa4ce86fb41a1172a4 (patch)
tree1d03d70ef852dd2935ed5c79c0bdf2a89c4706e5 /lib/parse/summary.js
parentbd7531f3cc848e1410e0f0bb6d22cba0a90972d8 (diff)
downloadgitbook-1d321207b045f7f9c34267fa4ce86fb41a1172a4.zip
gitbook-1d321207b045f7f9c34267fa4ce86fb41a1172a4.tar.gz
gitbook-1d321207b045f7f9c34267fa4ce86fb41a1172a4.tar.bz2
Normalize chapter & article paths
Diffstat (limited to 'lib/parse/summary.js')
-rw-r--r--lib/parse/summary.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/parse/summary.js b/lib/parse/summary.js
index 8787554..f021401 100644
--- a/lib/parse/summary.js
+++ b/lib/parse/summary.js
@@ -76,7 +76,12 @@ function parseTitle(src) {
return {
title: matches[1],
- path: matches[2],
+
+ // Replace .md references with .html
+ path: matches[2].replace(/\.md$/, '.html'),
+
+ // Original, non normalized path
+ _path: matches[2],
};
}