summaryrefslogtreecommitdiff
path: root/app/presenters/blob_presenter.rb
blob: 9980f6cd8a6d7f4f4ade3b631fbf224607fd4d45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

class BlobPresenter < Gitlab::View::Presenter::Simple
  presents :blob

  def highlight(plain: nil)
    Gitlab::Highlight.highlight(
      blob.path,
      blob.data,
      language: blob.language_from_gitattributes,
      plain: plain
    )
  end
end