mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 10:08:49 +01:00
Use blacklist for puctuators
Currently we can't use `/\p{L}/u` which would let use use a whitelist instead
Fixes #37079
This commit is contained in:
@@ -23,7 +23,7 @@ export const githubSlugifier: Slugifier = new class implements Slugifier {
|
||||
heading.trim()
|
||||
.toLowerCase()
|
||||
.replace(/\s+/g, '-') // Replace whitespace with -
|
||||
.replace(/[^\w\-]+/gu, '') // Remove non-word chars
|
||||
.replace(/[\]\[\!\'\#\$\%\&\'\(\)\*\+\,\.\/\:\;\<\=\>\?\@\\\^\_\{\|\}\~\`]/g, '') // Remove known puctuators
|
||||
.replace(/^\-+/, '') // Remove leading -
|
||||
.replace(/\-+$/, '') // Remove trailing -
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user