Browse Source

[🚀] ReplaceInvalidFilenameChars

bvbej 1 year ago
parent
commit
053690e475
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tool/helper.go

+ 1 - 1
tool/helper.go

@@ -322,7 +322,7 @@ func PortIsUse(port int) bool {
 
 // ReplaceInvalidFilenameChars 用下划线替换不合法文件名的字符
 func ReplaceInvalidFilenameChars(filename string) string {
-	pattern := regexp.MustCompile(`[\\/:*?"<>|{}'()!@#$%^&\[\];,]`)
+	pattern := regexp.MustCompile(`[\\/:*?"<>|{}'()!@#$%^&\[\];,+=~·!¥…()—{}、:“”‘’;,《》。?]`)
 	filename = pattern.ReplaceAllString(filename, "_")
 	return strings.ReplaceAll(filename, " ", "")
 }