From 373c42d1c55452138b83e22e919c5400137edb56 Mon Sep 17 00:00:00 2001 From: Youbing Li Date: Sun, 10 Feb 2019 20:45:06 -0500 Subject: [PATCH] Issue 71769: Correctly display '_' in the help message --- pkg/kubectl/util/templates/markdown.go | 4 +++- pkg/kubectl/util/templates/normalizers.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/kubectl/util/templates/markdown.go b/pkg/kubectl/util/templates/markdown.go index 1a19f89fd4..65ee886d10 100644 --- a/pkg/kubectl/util/templates/markdown.go +++ b/pkg/kubectl/util/templates/markdown.go @@ -46,8 +46,10 @@ func (r *ASCIIRenderer) NormalText(out *bytes.Buffer, text []byte) { lines := strings.Split(raw, linebreak) for _, line := range lines { trimmed := strings.Trim(line, " \n\t") + if len(trimmed) > 0 && trimmed[0] != '_' { + out.WriteString(" ") + } out.WriteString(trimmed) - out.WriteString(" ") } } diff --git a/pkg/kubectl/util/templates/normalizers.go b/pkg/kubectl/util/templates/normalizers.go index db7b17a7d6..f90412058a 100644 --- a/pkg/kubectl/util/templates/normalizers.go +++ b/pkg/kubectl/util/templates/normalizers.go @@ -70,7 +70,7 @@ type normalizer struct { func (s normalizer) markdown() normalizer { 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) return s }