From 6a46743cd389aeefc20348445fee2135a8e4c35c Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sat, 19 Feb 2022 07:36:40 +0000 Subject: Fix code copying in common browsers (#36580). Patch by Vitaly vit9696. git-svn-id: http://svn.redmine.org/redmine/trunk@21415 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/common/_diff.html.erb | 20 ++++++++++---------- app/views/common/_file.html.erb | 10 ++++++---- app/views/repositories/annotate.html.erb | 8 ++++++-- 3 files changed, 22 insertions(+), 16 deletions(-) (limited to 'app/views') diff --git a/app/views/common/_diff.html.erb b/app/views/common/_diff.html.erb index 35dfdea28..f54bdfa4c 100644 --- a/app/views/common/_diff.html.erb +++ b/app/views/common/_diff.html.erb @@ -6,7 +6,7 @@ <% diff.each do |table_file| -%>
<% if diff.diff_type == 'sbs' -%> - +
- + <% end -%> - + - + <% end -%> @@ -39,7 +39,7 @@
@@ -21,17 +21,17 @@ <% table_file.each_line do |spacing, line| -%> <% if spacing -%>
......
<%= line.nb_line_left %> -
<%= line.html_line_left.html_safe %>
+
<%= line.html_line_left.html_safe %>
<%= line.nb_line_right %> -
<%= line.html_line_right.html_safe %>
+
<%= line.html_line_right.html_safe %>
<% else -%> - +
<% end -%> - - + + <% end -%> diff --git a/app/views/common/_file.html.erb b/app/views/common/_file.html.erb index 95e0fb998..b0610f6ac 100644 --- a/app/views/common/_file.html.erb +++ b/app/views/common/_file.html.erb @@ -4,11 +4,13 @@ <% line_num = 1 %> <% syntax_highlight_lines(filename, Redmine::CodesetUtil.to_utf8_by_setting(content)).each do |line| %> - + <% line_num += 1 %> diff --git a/app/views/repositories/annotate.html.erb b/app/views/repositories/annotate.html.erb index 829090af6..de30e7c00 100644 --- a/app/views/repositories/annotate.html.erb +++ b/app/views/repositories/annotate.html.erb @@ -17,7 +17,7 @@ <% syntax_highlight_lines(@path, Redmine::CodesetUtil.to_utf8_by_setting(@annotate.content)).each do |line| %> <% revision = @annotate.revisions[line_num - 1] %> - + - + <% if line == "\n" or line == "\r\n" %> + + <% else %> + + <% end %> <% line_num += 1; previous_revision = revision %> <% end %> -- cgit v1.2.3
@@ -58,10 +58,10 @@
<%= line.nb_line_left %><%= line.nb_line_right %> -
<%= line.html_line.html_safe %>
+
<%= line.html_line.html_safe %>
- <%= line_num %> - -
<%= line.html_safe %>
+ <% if line == "\n" or line == "\r\n" %> +
+ <% else %> +
<%= line.html_safe %>
+ <% end %>
<%= line_num %> <% if revision && revision != previous_revision %> <%= revision.identifier ? @@ -31,7 +31,11 @@ <%= author.split('<').first %> <% end %>
<%= line.html_safe %>

<%= line.html_safe %>