From 9c01b83370792d9b0e6c2cb1903ca67191a76269 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 22 Mar 2018 14:33:27 -0500 Subject: [PATCH] link to README.md --- docs/index.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/index.html b/docs/index.html index 3b2738f88f..c9b0fda49b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -73,7 +73,7 @@
- +

Marked.js Documentation

@@ -92,14 +92,15 @@

Marked.js Documentation

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);