diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-04-22 10:58:15 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-04-22 10:58:15 +0000 |
commit | cf59496957f57749fb41d5dca3b28a79445f8953 (patch) | |
tree | 1fc926f27c5afef610763c8eb21e87be0593bad5 | |
parent | 32de29ea35c1b3e83faecee4ec49eb36bacb805f (diff) | |
download | redmine-cf59496957f57749fb41d5dca3b28a79445f8953.tar.gz redmine-cf59496957f57749fb41d5dca3b28a79445f8953.zip |
Fixed 10058: issue URL in repository comment break
git-svn-id: http://redmine.rubyforge.org/svn/trunk@465 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/helpers/application_helper.rb | 12 |
1 files 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 -> <a href="/issues/show/52">#52</a> + 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 -> <a href="/repositories/revision/6?rev=52">r52</a> (@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") |