Skip to content

Commit 413ee2b

Browse files
committed
refactor(regex): simplify regular expression
1 parent fbd03cc commit 413ee2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/helpers/comment-parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fm from 'front-matter';
22

33
const parseComment = (fileContent: string) => {
44
try {
5-
const allCommentBlocks = fileContent.match(/\/\*[\s\S]*?\*\/|([^:]|^)\/\/.*$/g);
5+
const allCommentBlocks = fileContent.match(/\/*[\s\S]*\/.*/g);
66
const vuepressBlock = allCommentBlocks?.filter((block: string) => {
77
return block.split('\n').filter(line => line.indexOf('@vuepress') >= 0).length;
88
})[0];

0 commit comments

Comments
 (0)