Index: app/helpers/application_helper.rb =================================================================== --- app/helpers/application_helper.rb (revision 2594) +++ app/helpers/application_helper.rb (working copy) @@ -15,8 +15,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require 'coderay' -require 'coderay/helpers/file_type' require 'forwardable' require 'cgi' @@ -216,8 +214,7 @@ end def syntax_highlight(name, content) - type = CodeRay::FileType[name] - type ? CodeRay.scan(content, type).html : h(content) + Redmine::SyntaxHighlighting.colorize_file(name, content) end def to_path_param(path) Index: app/views/settings/_general.rhtml =================================================================== --- app/views/settings/_general.rhtml (revision 2594) +++ app/views/settings/_general.rhtml (working copy) @@ -27,6 +27,9 @@
<%= select_tag 'settings[text_formatting]', options_for_select([[l(:label_none), "0"], *Redmine::WikiFormatting.format_names.collect{|name| [name, name]} ], Setting.text_formatting.to_sym) %>
++<%= select_tag 'settings[syntax_highlighter]', options_for_select( (Redmine::SyntaxHighlighting.available_highlighters.collect{|h| [h, h]}), Setting.syntax_highlighter) %>
+<%= select_tag 'settings[wiki_compression]', options_for_select( [[l(:label_none), 0], ["gzip", "gzip"]], Setting.wiki_compression) %>
Index: app/views/attachments/file.rhtml =================================================================== --- app/views/attachments/file.rhtml (revision 2594) +++ app/views/attachments/file.rhtml (working copy) @@ -8,7 +8,7 @@ -<%= render :partial => 'common/file', :locals => {:content => @content, :filename => @attachment.filename} %> +<%= render :partial => 'common/file', :locals => {:content => @content, :filename => @attachment.disk_filename} %> <% content_for :header_tags do -%> <%= stylesheet_link_tag "scm" -%> Index: app/views/common/_file.rhtml =================================================================== --- app/views/common/_file.rhtml (revision 2594) +++ app/views/common/_file.rhtml (working copy) @@ -1,9 +1,9 @@<%= line_num %> | <%= line %> |
---|---|
<%= line_num %> | <%= line %> |