File tree Expand file tree Collapse file tree 2 files changed +24
-10
lines changed Expand file tree Collapse file tree 2 files changed +24
-10
lines changed Original file line number Diff line number Diff line change 1
1
<ul >
2
2
<li ><a href =" #marked " >About</a ></li >
3
- <li ><a href =" #install " >Installation</a ></li >
3
+ <li ><a href =" #installation " >Installation</a ></li >
4
4
<li ><a href =" #usage " >Usage</a ></li >
5
5
<li ><a href =" #specifications " >Supported Markdown specifications</a ></li >
6
6
<li ><a href =" #security " >Security</a ></li >
11
11
12
12
<h2 id =" marked " >Marked</h2 >
13
13
14
- Marked is
14
+ Marked is
15
15
16
16
1 . built for speed.<sup >* </sup >
17
17
2 . a low-level markdown compiler that allows frequent parsing of large chunks of markdown without caching or blocking for long periods of time.<sup >** </sup >
@@ -96,4 +96,3 @@ For list of credited authors and contributors, please see our [authors page](AUT
96
96
Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
97
97
98
98
See [ license] ( https://github.com/markedjs/marked/blob/master/LICENSE.md ) for more details.
99
-
Original file line number Diff line number Diff line change 12
12
}
13
13
14
14
# container {
15
+ position : relative;
15
16
max-width : 800px ;
16
17
margin : auto;
17
18
padding : 10px ;
60
61
background-color : rgba (27 , 31 , 35 , 0.05 );
61
62
border-radius : 3px ;
62
63
}
64
+
65
+ .github-ribbon {
66
+ position : absolute;
67
+ top : 0 ;
68
+ right : 0 ;
69
+ border : 0 ;
70
+ }
63
71
</ style >
64
72
</ head >
65
73
< body >
66
74
< div id ="container ">
67
75
< header >
68
- < img src ="img/logo-black.svg " height ="64px " width ="64px " />
76
+ < a href ="README.md ">
77
+ < img src ="img/logo-black.svg " height ="64px " width ="64px " />
78
+ </ a >
69
79
< h1 > Marked.js Documentation</ h1 >
70
80
</ header >
71
-
81
+
82
+ < a href ="https://github.com/markedjs/marked ">
83
+ < img class ="github-ribbon " src ="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png " alt ="Fork me on GitHub ">
84
+ </ a >
85
+
72
86
< div id ="content "> </ div >
73
87
</ div >
74
88
< script src ="https://cdn.jsdelivr.net/npm/marked/marked.min.js "> </ script >
@@ -78,14 +92,15 @@ <h1>Marked.js Documentation</h1>
78
92
var content = document . querySelector ( '#content' ) ;
79
93
var body = document . querySelector ( 'html' ) ;
80
94
81
- content . addEventListener ( 'click' , function ( e ) {
82
- var a = e . target ;
83
- 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 ) {
84
98
var page = a . href . slice ( location . origin . length + location . pathname . length ) ;
85
99
if ( page . slice ( - 3 ) === '.md' ) {
86
100
e . preventDefault ( ) ;
87
101
fetchPage ( page ) ;
88
102
}
103
+ history . replaceState ( "" , document . title , "/" ) ;
89
104
}
90
105
} , false ) ;
91
106
@@ -100,8 +115,8 @@ <h1>Marked.js Documentation</h1>
100
115
+ '<p>' + e . message + '</p>' ;
101
116
} ) ;
102
117
}
103
-
118
+
104
119
fetchPage ( 'README.md' ) ;
105
120
</ script >
106
121
</ body >
107
- </ html >
122
+ </ html >
You can’t perform that action at this time.
0 commit comments