fix link of stack overflow

This commit is contained in:
Ryan Wu 2015-04-03 19:49:14 +08:00
parent b6f44688d6
commit cb0a3af5c5
2 changed files with 3 additions and 2 deletions

View File

@ -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論壇)
* [第二步,使用專案郵件列表](#第二步,使用專案郵件列表)
* [使用有意義且描述明確的標題](#使用有意義且描述明確的標題)

3
toc.js
View File

@ -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 = ['<pre>', indent, '* [', headerText, '](', '#', headerText, ')', '\n', '</pre>'];
result += link.join('');