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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2016-06-22 22:53:58 +0300
committerhttp://jneen.net/ <jneen@jneen.net>2016-06-28 00:17:49 +0300
commit66b37149eb72179e1b6329221b8a92e226e4e563 (patch)
tree1f1b9e12320bf54301964f0bc8f11b2970a9ea47 /lib/gitlab/highlight.rb
parente7b512efa65aebe26cd0240a4d077475c42761c1 (diff)
support cgi style options, such as erb?parent=json
Diffstat (limited to 'lib/gitlab/highlight.rb')
-rw-r--r--lib/gitlab/highlight.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/highlight.rb b/lib/gitlab/highlight.rb
index 7f8cfe706de..41296415e35 100644
--- a/lib/gitlab/highlight.rb
+++ b/lib/gitlab/highlight.rb
@@ -40,11 +40,11 @@ module Gitlab
private
def custom_language
- return nil if @repository.nil?
+ language_name = @repository && @repository.gitattribute(@blob_name, 'gitlab-language')
- language_name = @repository.gitattribute(@blob_name, 'gitlab-language')
+ return nil unless language_name
- Rouge::Lexer.find(language_name)
+ Rouge::Lexer.find_fancy(language_name)
end
def rouge_formatter(options = {})