Skip to content

Commit 9c01b83

Browse files
committed
link to README.md
1 parent fd9f444 commit 9c01b83

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/index.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<body>
7474
<div id="container">
7575
<header>
76-
<a href="/">
76+
<a href="README.md">
7777
<img src="img/logo-black.svg" height="64px" width="64px" />
7878
</a>
7979
<h1>Marked.js Documentation</h1>
@@ -92,14 +92,15 @@ <h1>Marked.js Documentation</h1>
9292
var content = document.querySelector('#content');
9393
var body = document.querySelector('html');
9494

95-
content.addEventListener('click', function (e) {
96-
var a = e.target;
97-
if (a.tagName.toLowerCase() === 'a' && a.href.indexOf(location.origin) === 0) {
95+
body.addEventListener('click', function (e) {
96+
var a = e.target.closest('a');
97+
if (a && a.href.indexOf(location.origin) === 0) {
9898
var page = a.href.slice(location.origin.length + location.pathname.length);
9999
if (page.slice(-3) === '.md') {
100100
e.preventDefault();
101101
fetchPage(page);
102102
}
103+
history.replaceState("", document.title, "/");
103104
}
104105
}, false);
105106

0 commit comments

Comments
 (0)