File tree Expand file tree Collapse file tree 2 files changed +6
-18
lines changed Expand file tree Collapse file tree 2 files changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,6 @@ function parseMd() {
6
6
var GITHUB =
7
7
"https://raw.githubusercontent.com/gto76/python-cheatsheet/master/README.md" ;
8
8
jQuery . get ( GITHUB , function ( text ) {
9
- console . log ( text ) ;
10
- text = removeMdToc ( text ) ;
11
- console . log ( text ) ;
12
9
var converter = new showdown . Converter ( ) ;
13
10
html = converter . makeHtml ( text ) ;
14
11
aDiv = $ ( "#main_container" ) ;
@@ -24,21 +21,11 @@ function parseMd() {
24
21
} ) ;
25
22
}
26
23
27
- function removeMdToc ( text ) {
28
- var out = [ ] ;
29
- lines = text . match ( / [ ^ \r \n ] + / g) ;
30
- insideContents = false ;
31
- for ( line of lines ) {
32
- if ( line . trim ( ) === "Contents" ) {
33
- insideContents = true ;
34
- } else if ( line . trim ( ) === "Main" ) {
35
- insideContents = false ;
36
- }
37
- if ( ! insideContents ) {
38
- out . push ( line ) ;
39
- }
40
- }
41
- return out . join ( "\n" ) ;
24
+ function removeOrigToc ( ) {
25
+ headerContents = $ ( "#contents" ) ;
26
+ contentsList = headerContents . next ( ) ;
27
+ headerContents . remove ( ) ;
28
+ contentsList . remove ( ) ;
42
29
}
43
30
44
31
function insertLinks ( ) {
Original file line number Diff line number Diff line change @@ -219,6 +219,7 @@ blockquote q:before,
219
219
blockquote q : after {
220
220
content : "" ;
221
221
}
222
+
222
223
h3 ,
223
224
h4 ,
224
225
p ,
You can’t perform that action at this time.
0 commit comments