Add fix in TOC JavaScript for in-page anchors

This commit is contained in:
Marcel Stör 2016-01-16 10:02:06 +01:00
parent b03a669683
commit 9efc4d5445
1 changed files with 2 additions and 2 deletions

View File

@ -35,8 +35,8 @@ var nodemcu = nodemcu || {};
}
function createTocTableRow(func, intro) {
// fragile attempt to auto-create the in-page anchor
var href = func.replace(/\./g, '').replace('()', '').replace(' --', '-');
var link = '<a href="#' + href + '">' + func + '</a>';
var href = func.replace(/\.|:/g, '').replace('()', '').replace(' --', '-').replace(/ /g, '-');
var link = '<a href="#' + href.toLowerCase() + '">' + func + '</a>';
return '<tr><td>' + link + '</td><td>' + intro + '</td></tr>';
}
}