Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions lib/utils/usage_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,18 @@ func formatUsageArg(arg *kingpin.ArgModel) string {
}

// formatHelp prints help text to include in a Markdown table cell. It escapes
// curly braces to avoid breaking the MDX parser, and it escapes pipes to
// avoid breaking the cell.
// curly, angle, and square braces to avoid breaking the MDX parser, and it
// escapes pipes to avoid breaking the cell.
func formatHelp(help string) string {
return strings.NewReplacer("{", `\{`, "}", `\}`, "|", `\|`).Replace(help)
return strings.NewReplacer(
"{", `\{`,
"}", `\}`,
"|", `\|`,
"[", `\[`,
"]", `\]`,
"<", `\<`,
">", `\>`,
).Replace(help)
}

// docsUsageTemplatePath points to a help text template for CLI reference
Expand Down
Loading