mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 20:49:01 +01: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;
|
|
}
|