Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
39def0dc
Commit
39def0dc
authored
May 26, 2012
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better fix for encoding problems on rendering of inline file visualizations like README files.
parent
eb5749ed
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
app/views/refs/_tree.html.haml
app/views/refs/_tree.html.haml
+2
-2
app/views/refs/_tree_file.html.haml
app/views/refs/_tree_file.html.haml
+1
-1
lib/gitlabhq/encode.rb
lib/gitlabhq/encode.rb
+3
-0
No files found.
app/views/refs/_tree.html.haml
View file @
39def0dc
...
...
@@ -42,9 +42,9 @@
.readme
-
if
content
.
name
=~
/\.(md|markdown)$/i
=
preserve
do
=
markdown
(
content
.
data
.
force_encoding
(
'UTF-8'
)
)
=
markdown
(
content
.
data
.
detect_encoding!
)
-
else
=
simple_format
(
content
.
data
.
force_encoding
(
'UTF-8'
)
)
=
simple_format
(
content
.
data
.
detect_encoding!
)
-
if
params
[
:path
]
-
history_path
=
tree_file_project_ref_path
(
@project
,
@ref
,
params
[
:path
])
...
...
app/views/refs/_tree_file.html.haml
View file @
39def0dc
...
...
@@ -13,7 +13,7 @@
#tree-readme-holder
.readme
=
preserve
do
=
markdown
(
file
.
data
.
force_encoding
(
'UTF-8'
)
)
=
markdown
(
file
.
data
.
detect_encoding!
)
-
else
.view_file_content
-
unless
file
.
empty?
...
...
lib/gitlabhq/encode.rb
View file @
39def0dc
# Patch Strings to enable detect_encoding! on views
require
'charlock_holmes/string'
module
Gitlabhq
module
Encode
extend
self
...
...
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