Merge pull request #72137 from YoubingLi/master

Issue 71769: Correctly display '_' in the help message
pull/564/head
Kubernetes Prow Robot 2019-02-21 03:54:11 -08:00 committed by GitHub
commit bad9f6341a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -46,9 +46,11 @@ func (r *ASCIIRenderer) NormalText(out *bytes.Buffer, text []byte) {
lines := strings.Split(raw, linebreak) lines := strings.Split(raw, linebreak)
for _, line := range lines { for _, line := range lines {
trimmed := strings.Trim(line, " \n\t") trimmed := strings.Trim(line, " \n\t")
out.WriteString(trimmed) if len(trimmed) > 0 && trimmed[0] != '_' {
out.WriteString(" ") out.WriteString(" ")
} }
out.WriteString(trimmed)
}
} }
// List renders the start and end of a list. // List renders the start and end of a list.

View File

@ -70,7 +70,7 @@ type normalizer struct {
func (s normalizer) markdown() normalizer { func (s normalizer) markdown() normalizer {
bytes := []byte(s.string) bytes := []byte(s.string)
formatted := blackfriday.Markdown(bytes, &ASCIIRenderer{Indentation: Indentation}, 0) formatted := blackfriday.Markdown(bytes, &ASCIIRenderer{Indentation: Indentation}, blackfriday.EXTENSION_NO_INTRA_EMPHASIS)
s.string = string(formatted) s.string = string(formatted)
return s return s
} }