Class: Gitlab::Diff::InlineDiffMarkdownMarker

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

Constant Summary collapse

MARKDOWN_SYMBOLS =
{
  addition: "+",
  deletion: "-"
}.freeze

Instance Attribute Summary

Attributes inherited from StringRangeMarker

#html_escaped, #raw_line, #rich_line

Instance Method Summary collapse

Methods inherited from StringRangeMarker

#initialize

Constructor Details

This class inherits a constructor from Gitlab::StringRangeMarker

Instance Method Details

#mark(line_inline_diffs, mode: nil) ⇒ Object


11
12
13
14
15
16
# File 'lib/gitlab/diff/inline_diff_markdown_marker.rb', line 11

def mark(line_inline_diffs, mode: nil)
  super(line_inline_diffs) do |text, left:, right:|
    symbol = MARKDOWN_SYMBOLS[mode]
    "{#{symbol}#{text}#{symbol}}"
  end
end