mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
fix(electron): filename escape (#9583)
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user