Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Aug 7, 2024
1 parent f67b265 commit 6570a30
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cmd/zetacored/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ func docsCmd(cmd *cobra.Command, args []string) error {
func GenMarkdownToSingleFile(cmd *cobra.Command, w *os.File) error {
buf := new(bytes.Buffer)
linkHandler := func(s string) string {
anchor := strings.ReplaceAll(strings.ToLower(s), " ", "-")
anchor = strings.ReplaceAll(anchor, "_", "-")
return "#" + anchor
return "#" + strings.NewReplacer(" ", "-", "_", "-").Replace(strings.ToLower(s))
}

cmd.DisableAutoGenTag = true
Expand Down

0 comments on commit 6570a30

Please sign in to comment.