Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(electron): filename escape (#9583)

forehalo0554df6bc2ec
diff --git a/packages/frontend/apps/electron/src/helper/workspace/meta.ts b/packages/frontend/apps/electron/src/helper/workspace/meta.ts
index 9026097145..dbe35c657d 100644
--- a/packages/frontend/apps/electron/src/helper/workspace/meta.ts
+++ b/packages/frontend/apps/electron/src/helper/workspace/meta.ts
@@ -44,8 +44,9 @@ export function escapeFilename(name: string) {
// replace all special characters with '_' and replace repeated '_' with a single '_' and remove trailing '_'
return name
.replaceAll(/[\\/!@#$%^&*()+~`"':;,?<>|]/g, '_')
- .replaceAll(/_+/g, '_')
- .replace(/_+$/, '');
+ .split('_')
+ .filter(Boolean)
+ .join('_');
}
export async function getSpaceDBPath(