Skip to content

Commit c195d2d

Browse files
committed
fix(slugify): GitHub compatible heading links, fixed #267
1 parent 0624e59 commit c195d2d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/render/slugify.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ const re = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,.\/:;<=>?@\[\]^`{|}~]/g
44
export function slugify (str) {
55
if (typeof str !== 'string') return ''
66

7+
str = /^[\w\s]+$/g.test(str) ? str.toLowerCase() : str
8+
79
let slug = str
8-
.toLowerCase()
910
.trim()
1011
.replace(/<[^>\d]+>/g, '')
1112
.replace(re, '')

0 commit comments

Comments
 (0)