Merge pull request #70 from alphapapa/minitoc-no-tags

Elide tags from minitoc
This commit is contained in:
Fabrice Niessen 2018-11-29 21:37:58 +01:00 committed by GitHub
commit 66f635313d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -47,8 +47,10 @@ $(function() {
function generateMiniToc(divId) {
$('#minitoc').empty().append('<h2>In this section</h2>');
$('#' + divId).find('h3').each(function(i) {
let pos = $(this).text().search(" ");
let text = $(this).text().substring(0, pos);
$("#minitoc").append("<a href='#" + $(this).attr("id") + "'>"
+ $(this).text() + "</a>");
+ text + "</a>");
});
// Ensure that the target is expanded (hideShow)
$('#minitoc a[href^="#"]').click(function() {