summaryrefslogtreecommitdiff
path: root/app/presenters/blob_presenter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/presenters/blob_presenter.rb')
-rw-r--r--app/presenters/blob_presenter.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/presenters/blob_presenter.rb b/app/presenters/blob_presenter.rb
index 3a71d2b87f3..e0077db8d5c 100644
--- a/app/presenters/blob_presenter.rb
+++ b/app/presenters/blob_presenter.rb
@@ -9,7 +9,7 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated
Gitlab::Highlight.highlight(
blob.path,
limited_blob_data(to: to),
- language: blob.language_from_gitattributes,
+ language: language,
plain: plain
)
end
@@ -37,4 +37,8 @@ class BlobPresenter < Gitlab::View::Presenter::Delegated
def all_lines
@all_lines ||= blob.data.lines
end
+
+ def language
+ blob.language_from_gitattributes
+ end
end