diff --git a/wrap.go b/wrap.go index 3dfe6e1..9ece984 100644 --- a/wrap.go +++ b/wrap.go @@ -28,6 +28,10 @@ func splitOnSpace(x string) []string { func wordWrap(m measureStringer, s string, width float64) []string { var result []string for _, line := range strings.Split(s, "\n") { + if strings.TrimSpace(line) == "" { + result = append(result, line) + continue + } fields := splitOnSpace(line) if len(fields)%2 == 1 { fields = append(fields, "")