diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 1a82bb8ce..d41977d29 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -22,6 +22,12 @@ module RepositoriesHelper txt.to_s[0,8] end + def truncate_at_line_break(text, length = 255) + if text + text.gsub(%r{^(.{#{length}}[^\n]*)\n.+$}m, '\\1...') + end + end + def render_properties(properties) unless properties.nil? || properties.empty? content = '' diff --git a/app/views/repositories/_revisions.rhtml b/app/views/repositories/_revisions.rhtml index a938fecb8..d8ca8007a 100644 --- a/app/views/repositories/_revisions.rhtml +++ b/app/views/repositories/_revisions.rhtml @@ -18,7 +18,7 @@