make #custom_language private
This commit is contained in:
parent
c8b52761bc
commit
e08ff468e8
1 changed files with 8 additions and 8 deletions
|
@ -27,14 +27,6 @@ module Gitlab
|
||||||
end
|
end
|
||||||
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)
|
def highlight(text, continue: true, plain: false)
|
||||||
if plain
|
if plain
|
||||||
@formatter.format(Rouge::Lexers::PlainText.lex(text)).html_safe
|
@formatter.format(Rouge::Lexers::PlainText.lex(text)).html_safe
|
||||||
|
@ -47,6 +39,14 @@ module Gitlab
|
||||||
|
|
||||||
private
|
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 = {})
|
def rouge_formatter(options = {})
|
||||||
options = options.reverse_merge(
|
options = options.reverse_merge(
|
||||||
nowrap: true,
|
nowrap: true,
|
||||||
|
|
Loading…
Reference in a new issue