diff options
author | Mark Chao <mchao@gitlab.com> | 2018-10-04 07:04:13 +0300 |
---|---|---|
committer | Mark Chao <mchao@gitlab.com> | 2018-10-30 10:44:55 +0300 |
commit | 623b7f3055e0dec033795b9d4eb625b781773834 (patch) | |
tree | 06461771f0c59c4cfde8ed868a06c7f6b9665dad /app | |
parent | a4ba973e24ef6767d635c0291c9b6ce8085aef28 (diff) |
Centralize loading blob data before highlighting
Diffstat (limited to 'app')
-rw-r--r-- | app/presenters/blob_presenter.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/presenters/blob_presenter.rb b/app/presenters/blob_presenter.rb index 9980f6cd8a6..6323c1b3389 100644 --- a/app/presenters/blob_presenter.rb +++ b/app/presenters/blob_presenter.rb @@ -4,6 +4,8 @@ class BlobPresenter < Gitlab::View::Presenter::Simple presents :blob def highlight(plain: nil) + blob.load_all_data! if blob.respond_to?(:load_all_data!) + Gitlab::Highlight.highlight( blob.path, blob.data, |