File tree 1 file changed +5
-4
lines changed 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 73
73
< body >
74
74
< div id ="container ">
75
75
< header >
76
- < a href ="/ ">
76
+ < a href ="README.md ">
77
77
< img src ="img/logo-black.svg " height ="64px " width ="64px " />
78
78
</ a >
79
79
< h1 > Marked.js Documentation</ h1 >
@@ -92,14 +92,15 @@ <h1>Marked.js Documentation</h1>
92
92
var content = document . querySelector ( '#content' ) ;
93
93
var body = document . querySelector ( 'html' ) ;
94
94
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 ) {
98
98
var page = a . href . slice ( location . origin . length + location . pathname . length ) ;
99
99
if ( page . slice ( - 3 ) === '.md' ) {
100
100
e . preventDefault ( ) ;
101
101
fetchPage ( page ) ;
102
102
}
103
+ history . replaceState ( "" , document . title , "/" ) ;
103
104
}
104
105
} , false ) ;
105
106
You can’t perform that action at this time.
0 commit comments