Issue 71769: Correctly display '_' in the help message

pull/564/head
Youbing Li 2019-02-10 20:45:06 -05:00
parent 698db70879
commit 373c42d1c5
2 changed files with 4 additions and 2 deletions

View File

@ -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(" ")
}
}

View File

@ -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
}