Commit 6abd43e2c2f3485e6cb9d32a138c77c54de6154f

Lea Verou 2014-04-21T06:16:51

Merge pull request #221 from nauzilus/toc-fix Fix ToC generator to work with base

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/code.js b/code.js
index fe9a679..02a3c27 100644
--- a/code.js
+++ b/code.js
@@ -71,7 +71,7 @@ $$('body > section > h1').forEach(function(h1) {
 		contents: {
 			tag: 'a',
 			properties: {
-				href: '#' + (h1.id || section.id)
+				href: window.location.pathname + '#' + (h1.id || section.id)
 			},
 			contents: text
 		},