From b4630c03f73276e5ae22cc1174413e51f36eaa1c Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 25 Feb 2012 06:01:48 +0000 Subject: Rails3: prevent double rendering file view and annotate on Rails 3.0.11 and Rails 3.1.3 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8988 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/helpers') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8d08e9d5b..8a4d387ad 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -355,6 +355,12 @@ module ApplicationHelper end end + def syntax_highlight_lines(name, content) + lines = [] + syntax_highlight(name, content).each_line { |line| lines << line } + lines + end + def syntax_highlight(name, content) Redmine::SyntaxHighlighting.highlight_by_filename(content, name) end -- cgit v1.2.3