problems with links in toc
This commit is contained in:
parent
d742c5ae44
commit
5239709fcf
2 changed files with 4 additions and 4 deletions
|
@ -20,8 +20,8 @@ Walter Higgins
|
||||||
* [config variable](#config-variable)
|
* [config variable](#config-variable)
|
||||||
* [events variable](#events-variable)
|
* [events variable](#events-variable)
|
||||||
* [Module variables](#module-variables)
|
* [Module variables](#module-variables)
|
||||||
* [__filename variable](#9595filename-variable)
|
* [__filename variable](#filename-variable)
|
||||||
* [__dirname variable](#9595dirname-variable)
|
* [__dirname variable](#dirname-variable)
|
||||||
* [Global functions](#global-functions)
|
* [Global functions](#global-functions)
|
||||||
* [echo function](#echo-function)
|
* [echo function](#echo-function)
|
||||||
* [require() function](#require-function)
|
* [require() function](#require-function)
|
||||||
|
|
|
@ -19,7 +19,7 @@ for (var i = 0; i < contents.length; i++){
|
||||||
line = contents[i];
|
line = contents[i];
|
||||||
if (line.match(/^##\s+/)){
|
if (line.match(/^##\s+/)){
|
||||||
var h2 = line.match(/^##\s+(.*)/)[1].trim();
|
var h2 = line.match(/^##\s+(.*)/)[1].trim();
|
||||||
var link = '' + java.net.URLDecoder.decode(h2,"UTF-8");
|
var link = h2.replace(/_/g,'');
|
||||||
link = link.replace(/[^a-zA-Z0-9 \-]/g,'');
|
link = link.replace(/[^a-zA-Z0-9 \-]/g,'');
|
||||||
link = link.replace(/ /g,'-');
|
link = link.replace(/ /g,'-');
|
||||||
link = link.toLowerCase();
|
link = link.toLowerCase();
|
||||||
|
@ -27,7 +27,7 @@ for (var i = 0; i < contents.length; i++){
|
||||||
}
|
}
|
||||||
if (line.match(/^###\s+/)){
|
if (line.match(/^###\s+/)){
|
||||||
var h3 = line.match(/^###\s+(.*)/)[1].trim();
|
var h3 = line.match(/^###\s+(.*)/)[1].trim();
|
||||||
var link = '' + java.net.URLDecoder.decode(h3,"UTF-8");
|
var link = h3.replace(/_/g,'');
|
||||||
link = link.replace(/[^a-zA-Z0-9 \-]/g,'');
|
link = link.replace(/[^a-zA-Z0-9 \-]/g,'');
|
||||||
var link = link.replace(/ /g,'-');
|
var link = link.replace(/ /g,'-');
|
||||||
link = link.toLowerCase();
|
link = link.toLowerCase();
|
||||||
|
|
Reference in a new issue