Skip to content
Snippets Groups Projects
Commit 39def0dc authored by Gabriel Mazetto's avatar Gabriel Mazetto
Browse files

Better fix for encoding problems on rendering of inline file visualizations like README files.

parent eb5749ed
No related branches found
No related tags found
1 merge request!864Fix many encoding problems
Loading
Loading
@@ -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])
Loading
Loading
Loading
Loading
@@ -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?
Loading
Loading
# Patch Strings to enable detect_encoding! on views
require 'charlock_holmes/string'
module Gitlabhq
module Encode
extend self
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment