Better looking slash characters
This commit is contained in:
parent
d844081d19
commit
d696911ac4
1 changed files with 3 additions and 3 deletions
6
file.go
6
file.go
|
@ -63,14 +63,14 @@ func copyFile(src, dst string) (error) {
|
|||
|
||||
func replaceDelimiters(input string) string {
|
||||
replacer := strings.NewReplacer(
|
||||
"/", "/",
|
||||
"\\", "\",
|
||||
"/", "⧸",
|
||||
"\\", "⧵",
|
||||
)
|
||||
return replacer.Replace(input)
|
||||
}
|
||||
|
||||
func sanitizeFilename(filename string) string {
|
||||
invalidFilenameChars := regexp.MustCompile(`[^a-zA-Z0-9._-/\[[:blank:]]]+`)
|
||||
invalidFilenameChars := regexp.MustCompile(`[^a-zA-Z0-9._-⧸⧵[[:blank:]]]+`)
|
||||
|
||||
sanitized := invalidFilenameChars.ReplaceAllString(filename, "-")
|
||||
|
||||
|
|
Loading…
Reference in a new issue