From: Rob Pike Date: Sat, 14 Jan 2012 19:57:32 +0000 (-0800) Subject: go/doc: print only one newline between paragraphs X-Git-Tag: weekly.2012-01-15~7 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2374edc6401401fcaa0d328bab38c9e3cffc9274;p=gostls13.git go/doc: print only one newline between paragraphs Fixes #2595. R=golang-dev, gri CC=golang-dev https://golang.org/cl/5544068 --- diff --git a/src/pkg/go/doc/comment.go b/src/pkg/go/doc/comment.go index 14809fec91..060e37bff1 100644 --- a/src/pkg/go/doc/comment.go +++ b/src/pkg/go/doc/comment.go @@ -353,12 +353,10 @@ func ToText(w io.Writer, text string, indent, preIndent string, width int) { width: width, indent: indent, } - for i, b := range blocks(text) { + for _, b := range blocks(text) { switch b.op { case opPara: - if i > 0 { - w.Write(nl) - } + // l.write will add leading newline if required for _, line := range b.lines { l.write(line) }