Skip to content

Commit

Permalink
fix: more generated filename cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishb committed Mar 11, 2024
1 parent 204179b commit 2ddb64f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/wp2hugo/internal/wpparser/wp_parser_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ func (i CommonFields) Filename() string {
str1 = strings.ReplaceAll(str1, "--", "-")
str1 = strings.ReplaceAll(str1, "-.", ".")
}
// Remove trailing "-"
// Remove leading and trailing "-"
if len(str1) > 1 {
str1 = strings.TrimPrefix(str1, "-")
}
if len(str1) > 1 {
str1 = strings.TrimSuffix(str1, "-")
}
Expand Down

0 comments on commit 2ddb64f

Please sign in to comment.