From dba73cf2149389212126e2be8a9706a429b79918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20St=C3=B6r?= Date: Thu, 13 Apr 2017 21:42:18 +0200 Subject: [PATCH] Fix HTML anchors in ToC generator --- docs/js/extra.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/js/extra.js b/docs/js/extra.js index fef3df6c..596fe815 100644 --- a/docs/js/extra.js +++ b/docs/js/extra.js @@ -38,7 +38,8 @@ var nodemcu = nodemcu || {}; } function createTocTableRow(func, intro) { // fragile attempt to auto-create the in-page anchor - var href = func.replace(/\.|:/g, '').replace('()', '').replace(' --', '-').replace(/ /g, '-'); + // good tests: file.md, + var href = func.replace(/[\.:\(\)]/g, '').replace(/ --|, | /g, '-'); var link = '' + func + ''; return '' + link + '' + intro + ''; } @@ -220,4 +221,4 @@ var nodemcu = nodemcu || {}; } return values; } -}()); \ No newline at end of file +}());