From 3cff2cc713cd4c7166b8b946e1c12cbba1dec9a5 Mon Sep 17 00:00:00 2001 From: samrose3 Date: Sun, 22 Jan 2017 19:07:41 -0500 Subject: [PATCH] Prevent copying of line numbers in parallel diff view --- app/views/projects/diffs/_parallel_view.html.haml | 4 ++-- .../unreleased/27021-line-numbers-now-in-copy-pasta-data.yml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/27021-line-numbers-now-in-copy-pasta-data.yml diff --git a/app/views/projects/diffs/_parallel_view.html.haml b/app/views/projects/diffs/_parallel_view.html.haml index b087485aa17..f361204ecac 100644 --- a/app/views/projects/diffs/_parallel_view.html.haml +++ b/app/views/projects/diffs/_parallel_view.html.haml @@ -14,7 +14,7 @@ - left_line_code = diff_file.line_code(left) - left_position = diff_file.position(left) %td.old_line.diff-line-num{ id: left_line_code, class: left.type, data: { linenumber: left.old_pos } } - %a{ href: "##{left_line_code}" }= raw(left.old_pos) + %a{ href: "##{left_line_code}", data: { linenumber: left.old_pos } } %td.line_content.parallel.noteable_line{ class: left.type, data: diff_view_line_data(left_line_code, left_position, 'old') }= diff_line_content(left.text) - else %td.old_line.diff-line-num.empty-cell @@ -27,7 +27,7 @@ - right_line_code = diff_file.line_code(right) - right_position = diff_file.position(right) %td.new_line.diff-line-num{ id: right_line_code, class: right.type, data: { linenumber: right.new_pos } } - %a{ href: "##{right_line_code}" }= raw(right.new_pos) + %a{ href: "##{right_line_code}", data: { linenumber: right.new_pos } } %td.line_content.parallel.noteable_line{ class: right.type, data: diff_view_line_data(right_line_code, right_position, 'new') }= diff_line_content(right.text) - else %td.old_line.diff-line-num.empty-cell diff --git a/changelogs/unreleased/27021-line-numbers-now-in-copy-pasta-data.yml b/changelogs/unreleased/27021-line-numbers-now-in-copy-pasta-data.yml new file mode 100644 index 00000000000..b5584749098 --- /dev/null +++ b/changelogs/unreleased/27021-line-numbers-now-in-copy-pasta-data.yml @@ -0,0 +1,4 @@ +--- +title: Prevent copying of line numbers in parallel diff view +merge_request: 8706 +author: