From 5485b8e215a32cbbdfaa14d4430495d6db2cd293 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Thu, 12 May 2022 15:56:25 -0700 Subject: [PATCH] Include `"` and '/' as puctuators for slugify (#149404) We already include `'` and `/` makes sense to treat as a puctuator too for titles such as `# do A / B` --- extensions/markdown-language-features/src/slugify.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/markdown-language-features/src/slugify.ts b/extensions/markdown-language-features/src/slugify.ts index c6a42d2ac15..fff44756814 100644 --- a/extensions/markdown-language-features/src/slugify.ts +++ b/extensions/markdown-language-features/src/slugify.ts @@ -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 - );