Skip to content

Commit c4eef9f

Browse files
committed
fix(index.js): 将#替换为空以修复pinyin分词错误
1 parent 55ef5ca commit c4eef9f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

webhook/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ function getContent(filename, data) {
6060
traversalArticle(data['nav'], (key, value) => {
6161
if(value == filename) title = key;
6262
});
63-
const h2 = lines.filter(e => e.match(h2reg));
63+
const h2 = lines.filter(e => e.match(h2reg)).map(e => `<h2>${e.replace(/^## /, '')}</h2>`);
6464

65+
others = others.map(e => e.replace(/^##+ /, ''));
6566

6667
remark.process(others.join('\n'), (err, file) => {
6768
if (err) {
@@ -73,6 +74,8 @@ function getContent(filename, data) {
7374
.replace("\\n\\n", "\\n");
7475
});
7576

77+
others.replace()
78+
7679
return [title, others, h2];
7780
}
7881

0 commit comments

Comments
 (0)