Skip to content

Commit 45160cc

Browse files
committed
Script.js fix
1 parent be03c16 commit 45160cc

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

web/script.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ $(document).ready(function() {
55
function parseMd() {
66
var GITHUB = 'https://raw.githubusercontent.com/gto76/python-cheatsheet/master/README.md';
77
jQuery.get(GITHUB, function(text) {
8-
console.log(text)
9-
text = removeMdToc(text);
10-
console.log(text)
8+
// console.log(text)
9+
// text = removeMdToc(text);
10+
// console.log(text)
1111
var converter = new showdown.Converter();
1212
html = converter.makeHtml(text);
1313
aDiv = $('#main_container');
1414
nodes = $.parseHTML(html);
1515
aDiv.after(nodes);
16+
removeOrigToc();
1617
insertLinks();
1718
d3.selectAll("code").each(function() { hljs.highlightBlock(this); });
1819
addToc();
@@ -36,6 +37,13 @@ function removeMdToc(text) {
3637
return out.join('\n');
3738
}
3839

40+
function removeOrigToc() {
41+
headerContents = $('#contents')
42+
contentsList = headerContents.next()
43+
headerContents.remove()
44+
contentsList.remove()
45+
}
46+
3947
function insertLinks() {
4048
$('h2').each(function() {
4149
aId = $(this).attr('id');

0 commit comments

Comments
 (0)