mirror of
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way.git
synced 2025-12-26 18:14:58 +08:00
fix link of stack overflow
This commit is contained in:
parent
b6f44688d6
commit
cb0a3af5c5
2 changed files with 3 additions and 2 deletions
3
toc.js
3
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 = ['<pre>', indent, '* [', headerText, '](', '#', headerText, ')', '\n', '</pre>'];
|
||||
result += link.join('');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue