/
githubmirror
/
marktext
Обзор
Документация
Войти
/
githubmirror
/
marktext
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/muya/src/utils/slug.ts
10 строк
341 B
Ran Luo
chore(muya): remove redundant comments added during the muyajs port (#4463)
12 июн 2026, 09:17
Не верифицирован
12 июн 2026, 09:17
64e590c
Код
Авторство
О чём код?
// The regex uses ASCII `\w`, so CJK and emoji collapse to hyphens. A // Unicode-aware variant would be a separate, opt-in change. export function generateGithubSlug(text: string): string { return text .trim() .toLowerCase() .replace(/[^\w\s-]/g, '') .replace(/\s+/g, '-') .replace(/-+/g, '-'); }