Allow underscores in rendered md headers (#161149)

Follow up from https://github.com/microsoft/vscode-markdown-languageservice/pull/49
This commit is contained in:
Matt Bierner 2022-09-16 17:52:50 -07:00 committed by GitHub
parent 4c9c3f628d
commit a10bdfb49b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,7 +24,7 @@ export const githubSlugifier: Slugifier = new class implements Slugifier {
.toLowerCase()
.replace(/\s+/g, '-') // Replace whitespace with -
// allow-any-unicode-next-line
.replace(/[\]\[\!\/\'\"\#\$\%\&\(\)\*\+\,\.\/\:\;\<\=\>\?\@\\\^\_\{\|\}\~\`。,、;:?!…—·ˉ¨‘’“”々~‖∶"'`|〃〔〕〈〉《》「」『』.〖〗【】()[]{}]/g, '') // Remove known punctuators
.replace(/[\]\[\!\/\'\"\#\$\%\&\(\)\*\+\,\.\/\:\;\<\=\>\?\@\\\^\{\|\}\~\`。,、;:?!…—·ˉ¨‘’“”々~‖∶"'`|〃〔〕〈〉《》「」『』.〖〗【】()[]{}]/g, '') // Remove known punctuators
.replace(/^\-+/, '') // Remove leading -
.replace(/\-+$/, '') // Remove trailing -
);