Merge pull request #868 from SaitoWu/bugfix/encoding

Bugfix/encoding
This commit is contained in:
Dmitriy Zaporozhets 2012-05-30 00:24:43 -07:00
commit 2cf8010792
6 changed files with 38 additions and 29 deletions

View file

@ -58,14 +58,14 @@ module CommitsHelper
next if line.match(/^\-\-\- a/)
next if line.match(/^\+\+\+ b/)
full_line = html_escape(line.gsub(/\n/, '')).force_encoding("UTF-8")
full_line = html_escape(line.gsub(/\n/, ''))
if line.match(/^@@ -/)
type = "match"
line_old = line.match(/\-[0-9]*/)[0].to_i.abs rescue 0
line_new = line.match(/\+[0-9]*/)[0].to_i.abs rescue 0
next if line_old == 1 && line_new == 1
yield(full_line, type, nil, nil, nil)
next

View file

@ -42,9 +42,9 @@
.readme
- if content.name =~ /\.(md|markdown)$/i
= preserve do
= markdown(content.data.detect_encoding!)
= markdown(content.data)
- else
= simple_format(content.data.detect_encoding!)
= simple_format(content.data)
- if params[:path]
- history_path = tree_file_project_ref_path(@project, @ref, params[:path])

View file

@ -13,7 +13,7 @@
#tree-readme-holder
.readme
= preserve do
= markdown(file.data.detect_encoding!)
= markdown(file.data)
- else
.view_file_content
- unless file.empty?