mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 20:06:08 +01:00
fix(share): heading and navigation not supporting CJK (closes #6430)
This commit is contained in:
@@ -497,6 +497,14 @@ export function formatSize(size: number | null | undefined) {
|
||||
}
|
||||
}
|
||||
|
||||
export function slugify(text: string) {
|
||||
return text
|
||||
.normalize("NFKD") // handles accents like é → e
|
||||
.toLowerCase()
|
||||
.replace(/[^\p{Letter}\p{Number}]+/gu, "-") // keep Unicode letters/numbers
|
||||
.replace(/(^-|-$)+/g, ""); // trim leading/trailing dashes
|
||||
}
|
||||
|
||||
export default {
|
||||
compareVersions,
|
||||
crash,
|
||||
|
||||
Reference in New Issue
Block a user