You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vuepress has updated its slugify function (for both v1 and next/v2):
constrControl=/[\u0000-\u001f]/gconstrSpecial=/[\s~`!@#$%^&*()\-_+=[\]{}|\\;:"'“”‘’–—<>,.?/]+/gconstrCombining=/[\u0300-\u036F]/gexportconstslugify=(str: string): string=>str.normalize('NFKD')// Remove accents.replace(rCombining,'')// Remove control characters.replace(rControl,'')// Replace special characters.replace(rSpecial,'-')// Remove continuos separators.replace(/-{2,}/g,'-')// Remove prefixing and trailing separators.replace(/^-+|-+$/g,'')// ensure it doesn't start with a number (#121).replace(/^(\d)/,'_$1')// lowercase.toLowerCase()
It adds steps of normalizing and removing accents, and no longer requires diacritics dependency. Also, rSpecial adds some new characters.
It's time to fix it now, but should we change defaultSlugify function directly or add a new function / config for vuepress preset?
The text was updated successfully, but these errors were encountered:
Vuepress has updated its slugify function (for both v1 and next/v2):
It adds steps of normalizing and removing accents, and no longer requires
diacritics
dependency. Also,rSpecial
adds some new characters.It's time to fix it now, but should we change
defaultSlugify
function directly or add a new function / config for vuepress preset?The text was updated successfully, but these errors were encountered: