From cf59496957f57749fb41d5dca3b28a79445f8953 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 22 Apr 2007 10:58:15 +0000 Subject: [PATCH] Fixed 10058: issue URL in repository comment break git-svn-id: http://redmine.rubyforge.org/svn/trunk@465 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 47dbadfb7..2583116c8 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -135,15 +135,15 @@ module ApplicationHelper # [[link|title]] -> "title":link text = text.gsub(/\[\[([^\]\|]+)(\|([^\]\|]+))?\]\]/) {|m| "\"#{$3 || $1}\":" + format_wiki_link.call(Wiki.titleize($1)) } - # turn issue ids to textile links + # turn issue ids into links # example: - # #52 -> "#52":/issues/show/52 - text = text.gsub(/#(\d+)(?=\b)/) {|m| "\"##{$1}\":" + url_for(:controller => 'issues', :action => 'show', :id => $1) } + # #52 -> #52 + text = text.gsub(/#(\d+)(?=\b)/) {|m| link_to "##{$1}", :controller => 'issues', :action => 'show', :id => $1} - # turn revision ids to textile links (@project needed) + # turn revision ids into links (@project needed) # example: - # r52 -> "r52":/repositories/revision/6?rev=52 (@project.id is 6) - text = text.gsub(/(?=\b)r(\d+)(?=\b)/) {|m| "\"r#{$1}\":" + url_for(:controller => 'repositories', :action => 'revision', :id => @project.id, :rev => $1) } if @project + # r52 -> r52 (@project.id is 6) + text = text.gsub(/(?=\b)r(\d+)(?=\b)/) {|m| link_to "r#{$1}", :controller => 'repositories', :action => 'revision', :id => @project.id, :rev => $1} if @project # finally textilize text @do_textilize ||= (Setting.text_formatting == 'textile') && (ActionView::Helpers::TextHelper.method_defined? "textilize")