- Introduced profile selection modal for creating notes from interview profiles. - Added settings for interview configuration path, auto-starting interviews, and intercepting unresolved link clicks. - Updated package files to include YAML dependency for configuration handling. - Enhanced CSS for profile selection and interview wizard UI elements.
16 lines
504 B
TypeScript
16 lines
504 B
TypeScript
/**
|
|
* Convert string to URL-safe slug (a-z0-9_).
|
|
* Used for file names.
|
|
*/
|
|
export function slugify(text: string): string {
|
|
if (!text) return "";
|
|
|
|
return text
|
|
.toLowerCase()
|
|
.normalize("NFD") // Decompose accented characters
|
|
.replace(/[\u0300-\u036f]/g, "") // Remove diacritics
|
|
.replace(/[^a-z0-9_]+/g, "_") // Replace non-alphanumeric with underscore
|
|
.replace(/^_+|_+$/g, "") // Remove leading/trailing underscores
|
|
.replace(/_+/g, "_"); // Collapse multiple underscores
|
|
}
|