summaryrefslogtreecommitdiffstats
path: root/lib/parse/summary.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/parse/summary.js')
-rw-r--r--lib/parse/summary.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/parse/summary.js b/lib/parse/summary.js
index fd300bc..c73a072 100644
--- a/lib/parse/summary.js
+++ b/lib/parse/summary.js
@@ -81,8 +81,10 @@ function parseTitle(src, nums) {
title: matches[1],
level: level,
- // Replace .md references with .html
- path: matches[2].replace(/\\/g, '/'),
+ // Normalize path
+ // 1. Convert Window's "\" to "/"
+ // 2. Remove leading "/" if exists
+ path: matches[2].replace(/\\/g, '/').replace(/^\/+/, ''),
};
}