mirror of
https://github.com/golang/go
synced 2024-11-21 16:54:46 -07:00
go/doc: print only one newline between paragraphs
Fixes #2595. R=golang-dev, gri CC=golang-dev https://golang.org/cl/5544068
This commit is contained in:
parent
4cfa9e3c61
commit
2374edc640
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user