Skip to content

Commit

Permalink
Merge pull request #246 from ekohl/handle-missing-description
Browse files Browse the repository at this point in the history
Handle a missing description gracefully
  • Loading branch information
sanfrancrisko authored Aug 17, 2020
2 parents a76dd4c + 6a50149 commit 496ec8e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/puppet-strings/markdown/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def private?
end

def word_wrap(text, line_width: 120, break_sequence: "\n")
return unless text
text.split("\n").collect! do |line|
line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\s+|$)/, "\\1#{break_sequence}").strip : line
end * break_sequence
Expand Down

0 comments on commit 496ec8e

Please sign in to comment.