BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
dfce7b62
Commit
dfce7b62
authored
May 20, 2015
by
Hannes Rosenögger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
workaround for buggy lexers
if something goes wrong, fall back to the plaintext lexer
parent
76a75823
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
CHANGELOG
CHANGELOG
+1
-0
blob_helper.rb
app/helpers/blob_helper.rb
+4
-2
No files found.
CHANGELOG
View file @
dfce7b62
...
...
@@ -4,6 +4,7 @@ v 7.12.0 (unreleased)
- Allow to configure location of the `.gitlab_shell_secret` file. (Jakub Jirutka)
v 7.11.0 (unreleased)
- Fall back to Plaintext when Syntaxhighlighting doesn't work. Fixes some buggy lexers (Hannes Rosenögger)
- Fix broken view when viewing history of a file that includes a path that used to be another file (Stan Hu)
- Don't show duplicate deploy keys
- Fix commit time being displayed in the wrong timezone in some cases (Hannes Rosenögger)
...
...
app/helpers/blob_helper.rb
View file @
dfce7b62
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment