Index: app/models/project.rb =================================================================== --- app/models/project.rb (revision 17839) +++ app/models/project.rb (working copy) @@ -620,9 +620,13 @@ name end - # Returns a short description of the projects (first lines) + # Returns a short description of the projects (first 3 lines) def short_description(length = 255) - description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description + if description + description =~ /\A(?>[^\r\n]*(?:\r\n?|\n)?){0,3}/ + s = $&.strip[0...length] + s << '...' if s != description + end end def css_classes