Commit 2374edc6 authored by Rob Pike's avatar Rob Pike

go/doc: print only one newline between paragraphs

Fixes #2595.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5544068
parent 4cfa9e3c
......@@ -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)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment