fix #15
This commit is contained in:
parent
0eef991a94
commit
d470cff8de
|
|
@ -43,12 +43,8 @@ module.exports = {
|
|||
var text = lines[i].split('## ')[1];
|
||||
if (text != undefined) {
|
||||
lineStr = text.replace(/^\s+|\s+$/g, '');
|
||||
//去除链接
|
||||
lineStr = lineStr.replace(/\[(.*?)\]\(.*?\)/g, '$1');
|
||||
//去除所有空格
|
||||
hashStr = lineStr.replace(/\s+/g, '');
|
||||
//添加内容
|
||||
contents += '1. [' + lineStr + '](#' + hashStr + ' "' + lineStr + '")\n';
|
||||
lineStr = lineStr.replace(/\[(.*?)\]\(.*?\)/g, '$1'); //去除链接
|
||||
contents += '1. [' + lineStr + '](#' + lineStr + ' "' + lineStr + '")\n';
|
||||
}
|
||||
break;
|
||||
case '###':
|
||||
|
|
@ -56,8 +52,7 @@ module.exports = {
|
|||
if (text != undefined) {
|
||||
lineStr = text.replace(/^\s+|\s+$/g, '');
|
||||
lineStr = lineStr.replace(/\[(.*?)\]\(.*?\)/g, '$1');
|
||||
hashStr = lineStr.replace(/\s+/g, '');
|
||||
contents += '\t1. [' + lineStr + '](#' + hashStr + ' "' + lineStr + '")\n';
|
||||
contents += '\t1. [' + lineStr + '](#' + lineStr + ' "' + lineStr + '")\n';
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue