Change: Elide tags from minitoc

This commit is contained in:
Adam Porter 2017-12-06 20:41:47 -06:00
parent 4e09cdf3b6
commit 14e77769ae
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() {