File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments