Class: Gitlab::Diff::InlineDiffMarker

Inherits:
StringRangeMarker show all
Defined in:
lib/gitlab/diff/inline_diff_marker.rb

Instance Attribute Summary

Attributes inherited from StringRangeMarker

#html_escaped, #raw_line, #rich_line

Instance Method Summary collapse

Constructor Details

#initialize(line, rich_line = nil) ⇒ InlineDiffMarker

Returns a new instance of InlineDiffMarker.


6
7
8
# File 'lib/gitlab/diff/inline_diff_marker.rb', line 6

def initialize(line, rich_line = nil)
  super(line, rich_line || line)
end

Instance Method Details

#mark(line_inline_diffs, mode: nil) ⇒ Object


10
11
12
13
14
# File 'lib/gitlab/diff/inline_diff_marker.rb', line 10

def mark(line_inline_diffs, mode: nil)
  super(line_inline_diffs) do |text, left:, right:|
    %{<span class="#{html_class_names(left, right, mode)}">#{text}</span>}.html_safe
  end
end