[27769] Always use plain formatter for revision commits

https://community.openproject.com/wp/27769
pull/6324/head
Oliver Günther 7 years ago
parent 3123c2c65a
commit 3e342935ce
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 6
      app/helpers/repositories_helper.rb
  2. 2
      app/views/repositories/_revisions.html.erb
  3. 2
      app/views/repositories/revision.html.erb

@ -40,6 +40,12 @@ module RepositoriesHelper
end
end
##
# Format revision commits with plain formatter
def format_revision_text(commit_message)
format_text(commit_message, format: 'plain')
end
def truncate_at_line_break(text, length = 255)
if text
text.gsub(%r{^(.{#{length}}[^\n]*)\n.+$}m, '\\1...')

@ -128,7 +128,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%=h changeset.author %>
</td>
<td class="comments">
<%= format_text(truncate_at_line_break(Changeset.to_utf8(changeset.comments, changeset.repository.repo_log_encoding))) %>
<%= format_revision_text(truncate_at_line_break(Changeset.to_utf8(changeset.comments, changeset.repository.repo_log_encoding))) %>
</td>
</tr>
<% line_num += 1 %>

@ -51,7 +51,7 @@ See doc/COPYRIGHT.rdoc for more details.
<p><% if @changeset.scmid %>ID: <%= h(@changeset.scmid) %><br />
<% end %>
<span class="author"><%= authoring(@changeset.committed_on, @changeset.author) %></span></p>
<%= format_text @changeset.comments %>
<%= format_revision_text @changeset.comments %>
<% if @changeset.work_packages.visible.any? %>
<h3><%= l(:label_related_work_packages) %></h3>
<ul>

Loading…
Cancel
Save