Skip to content

Commit 11d63f9

Browse files
committed
Preserve underscores in titles
1 parent 6e3b258 commit 11d63f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class MarkdownToc {
102102

103103
const link = title.toLocaleLowerCase()
104104
.replace(/\s/g, "-")
105-
.replace(/[^A-Za-z0-9-]/g, "");
105+
.replace(/[^A-Za-z0-9-_]/g, "");
106106
const menu = `${" ".repeat(level - topLevel)}- [${title}](#${link})`;
107107
menus.push(menu);
108108

0 commit comments

Comments
 (0)