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:
Diffstat (limited to 'app/helpers/blob_helper.rb')
-rw-r--r--app/helpers/blob_helper.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb
index 885ac5f85b8..9fe5f82f02f 100644
--- a/app/helpers/blob_helper.rb
+++ b/app/helpers/blob_helper.rb
@@ -9,11 +9,13 @@ module BlobHelper
begin
lexer = Rugments::Lexer.guess(filename: blob_name, source: blob_content)
- rescue Rugments::Lexer::AmbiguousGuess
+ result = formatter.format(lexer.lex(blob_content)).html_safe
+ rescue
lexer = Rugments::Lexers::PlainText
+ result = formatter.format(lexer.lex(blob_content)).html_safe
end
- formatter.format(lexer.lex(blob_content)).html_safe
+ result
end
def no_highlight_files