mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 10:22:29 +08:00
7 lines
255 B
TypeScript
7 lines
255 B
TypeScript
export default function sanitizeAttributeName(origName: string) {
|
|
const fixedName = origName === "" ? "unnamed" : origName.replace(/[^\p{L}\p{N}_:]/gu, "_");
|
|
// any not allowed character should be replaced with underscore
|
|
|
|
return fixedName;
|
|
}
|