summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/blob_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb
index 8133de90a41..bb72232edd7 100644
--- a/app/controllers/projects/blob_controller.rb
+++ b/app/controllers/projects/blob_controller.rb
@@ -52,7 +52,9 @@ class Projects::BlobController < Projects::ApplicationController
def preview
@content = params[:content]
diffy = Diffy::Diff.new(@blob.data, @content, diff: '-U 3', include_diff_info: true)
- @diff_lines = Gitlab::Diff::Parser.new.parse(diffy.diff.scan(/.*\n/))
+ diff_lines = diffy.diff.scan(/.*\n/)[2..-1]
+ diff_lines = Gitlab::Diff::Parser.new.parse(diff_lines)
+ @diff_lines = Gitlab::Diff::Highlight.new(diff_lines).highlight
render layout: false
end