Browse Source

Fixed RemovedMdToc

pull/23/head
Jure Šorn 5 years ago
parent
commit
256e03d0eb
1 changed files with 3 additions and 1 deletions
  1. 4
      web/script.js

4
web/script.js

@ -5,7 +5,9 @@ $(document).ready(function() {
function parseMd() { function parseMd() {
var GITHUB = 'https://raw.githubusercontent.com/gto76/python-cheatsheet/master/README.md'; var GITHUB = 'https://raw.githubusercontent.com/gto76/python-cheatsheet/master/README.md';
jQuery.get(GITHUB, function(text) { jQuery.get(GITHUB, function(text) {
console.log(text)
text = removeMdToc(text); text = removeMdToc(text);
console.log(text)
var converter = new showdown.Converter(); var converter = new showdown.Converter();
html = converter.makeHtml(text); html = converter.makeHtml(text);
aDiv = $('#main_container'); aDiv = $('#main_container');
@ -38,7 +40,7 @@ function insertLinks() {
$('h2').each(function() { $('h2').each(function() {
aId = $(this).attr('id'); aId = $(this).attr('id');
$(this).append('<a href="#'+aId+'" name="'+aId+'">#</a>'); $(this).append('<a href="#'+aId+'" name="'+aId+'">#</a>');
})
});
} }
function addToc() { function addToc() {

Loading…
Cancel
Save