summaryrefslogtreecommitdiff
path: root/lib/gitlab/highlight.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/highlight.rb')
-rw-r--r--lib/gitlab/highlight.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/gitlab/highlight.rb b/lib/gitlab/highlight.rb
index 36ab622fff6..7f8cfe706de 100644
--- a/lib/gitlab/highlight.rb
+++ b/lib/gitlab/highlight.rb
@@ -27,14 +27,6 @@ module Gitlab
end
end
- def custom_language
- return nil if @repository.nil?
-
- language_name = @repository.gitattribute(@blob_name, 'gitlab-language')
-
- Rouge::Lexer.find(language_name)
- end
-
def highlight(text, continue: true, plain: false)
if plain
@formatter.format(Rouge::Lexers::PlainText.lex(text)).html_safe
@@ -47,6 +39,14 @@ module Gitlab
private
+ def custom_language
+ return nil if @repository.nil?
+
+ language_name = @repository.gitattribute(@blob_name, 'gitlab-language')
+
+ Rouge::Lexer.find(language_name)
+ end
+
def rouge_formatter(options = {})
options = options.reverse_merge(
nowrap: true,