diff --git a/README.md b/README.md index f09cfc7..4d51c6f 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Copyleft 2001 by D.H.Grand(nOBODY/Ginux), 2010 by Gasolin, 2015 by Ryan Wu * [在提問之前](#在提問之前) * [當你提問時](#當你提問時) * [慎選提問的論壇](#慎選提問的論壇) - * [Stack Overflow](#Stack Overflow) + * [Stack-Overflow](#Stack-Overflow) * [網站和IRC論壇](#網站和IRC論壇) * [第二步,使用專案郵件列表](#第二步,使用專案郵件列表) * [使用有意義且描述明確的標題](#使用有意義且描述明確的標題) diff --git a/toc.js b/toc.js index 9f9a903..695dbe4 100644 --- a/toc.js +++ b/toc.js @@ -8,7 +8,8 @@ for (var i = 3; i < headers.length; i++) { //skip H1, history, and toc var header = headers[i], headerText = header.textContent.trim(), - hIndex = parseInt(header.nodeName.substring(1)) - 1, + headerText = headerText.replace(" ", "-"); + var hIndex = parseInt(header.nodeName.substring(1)) - 1, indent = " ".repeat(hIndex), link = ['
', indent, '* [', headerText, '](', '#', headerText, ')', '\n', '']; result += link.join('');