Skip to content

Commit

Permalink
Updated code
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Dec 30, 2022
1 parent 2cbc7b7 commit f9fd6aa
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 131 deletions.
8 changes: 7 additions & 1 deletion cmd/root.go
Expand Up @@ -418,6 +418,11 @@ func wordWrap(s string, limit int) string {
// convert slice/array back to string
// but insert <br> at specified limit
// unless the current slice contains a Markdown link or code block or code
hasMore := len(strSlice) > currentLimit

if hasMore && len(result) > 0 {
result += " "
}

if len(strSlice) < currentLimit {
currentLimit = len(strSlice)
Expand All @@ -438,5 +443,6 @@ func wordWrap(s string, limit int) string {
currentLimit = len(strSlice)
}
}
return result

return strings.TrimSpace(result)
}

0 comments on commit f9fd6aa

Please sign in to comment.