Fix flags usage markdown output
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
6
vendor/github.com/docker/cli-docs-tool/clidocstool_md.go
generated
vendored
6
vendor/github.com/docker/cli-docs-tool/clidocstool_md.go
generated
vendored
@@ -179,10 +179,14 @@ func mdCmdOutput(cmd *cobra.Command, old string) (string, error) {
|
||||
}
|
||||
name += "`"
|
||||
name = mdMakeLink(name, f.Name, f, isLink)
|
||||
fmt.Fprintf(b, "%s | %s |\n", name, f.Usage)
|
||||
fmt.Fprintf(b, "%s | %s |\n", mdEscapePipe(name), mdEscapePipe(f.Usage))
|
||||
})
|
||||
fmt.Fprintln(b, "")
|
||||
}
|
||||
|
||||
return b.String(), nil
|
||||
}
|
||||
|
||||
func mdEscapePipe(s string) string {
|
||||
return strings.ReplaceAll(s, `|`, `\|`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user