making rows function shared

This commit is contained in:
2023-01-22 20:49:55 +02:00
parent a452bd5d8d
commit b0c2d46c48
2 changed files with 10 additions and 10 deletions

View File

@ -30,5 +30,15 @@ module Merged
self.renderer.render(text).html_safe
end
def rows( text )
return 5 if text.blank?
text = text.text unless text.is_a?(String)
return 5 if text.blank?
rows = (text.length / 50).to_i
rows += text.count("\n")
return 5 if rows < 5
rows
end
end
end