Welcome to mirror list, hosted at ThFree Co, Russian Federation.

inline_diff_markdown_marker.rb « diff « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c2a2eb159311faa98a46414d971c5d88581e67af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Gitlab
  module Diff
    class InlineDiffMarkdownMarker < Gitlab::StringRangeMarker
      MARKDOWN_SYMBOLS = {
        addition: "+",
        deletion: "-"
      }.freeze

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