Skip to content

Commit

Permalink
link to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Mar 22, 2018
1 parent fd9f444 commit 9c01b83
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docs/index.html
Expand Up @@ -73,7 +73,7 @@
<body>
<div id="container">
<header>
<a href="/">
<a href="README.md">
<img src="img/logo-black.svg" height="64px" width="64px" />
</a>
<h1>Marked.js Documentation</h1>
Expand All @@ -92,14 +92,15 @@ <h1>Marked.js Documentation</h1>
var content = document.querySelector('#content');
var body = document.querySelector('html');

content.addEventListener('click', function (e) {
var a = e.target;
if (a.tagName.toLowerCase() === 'a' && a.href.indexOf(location.origin) === 0) {
body.addEventListener('click', function (e) {
var a = e.target.closest('a');
if (a && a.href.indexOf(location.origin) === 0) {
var page = a.href.slice(location.origin.length + location.pathname.length);
if (page.slice(-3) === '.md') {
e.preventDefault();
fetchPage(page);
}
history.replaceState("", document.title, "/");
}
}, false);

Expand Down

0 comments on commit 9c01b83

Please sign in to comment.