diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-03-20 18:09:14 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-03-20 18:09:14 +0000 |
commit | f19e8af33b1af64cbb6e595e54492b649ecc7ef2 (patch) | |
tree | ed37ecce84553f31bc5af978093870e11b4bdbed /app/helpers | |
parent | a559c0cfc2e9c60cb41b001c87948ac7a41ead20 (diff) | |
download | redmine-f19e8af33b1af64cbb6e595e54492b649ecc7ef2.tar.gz redmine-f19e8af33b1af64cbb6e595e54492b649ecc7ef2.zip |
fixed #9404 Issue and revision textile links in issue notes
git-svn-id: http://redmine.rubyforge.org/svn/trunk@353 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 21f1b0247..d1597e8d1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -119,12 +119,12 @@ module ApplicationHelper # turn issue ids to textile links # example: # #52 -> "#52":/issues/show/52 - text = text.gsub(/#(\d+)([\s\.\(\)\-,:;])/) {|m| "\"##{$1}\":" + url_for(:controller => 'issues', :action => 'show', :id => $1) + $2 } + text = text.gsub(/#(\d+)(?=\b)/) {|m| "\"##{$1}\":" + url_for(:controller => 'issues', :action => 'show', :id => $1) } # turn revision ids to textile links (@project needed) # example: # r52 -> "r52":/repositories/revision/6?rev=52 (@project.id is 6) - text = text.gsub(/r(\d+)([\s\.\(\)\-,:;])/) {|m| "\"r#{$1}\":" + url_for(:controller => 'repositories', :action => 'revision', :id => @project.id, :rev => $1) + $2 } if @project + text = text.gsub(/r(\d+)(?=\b)/) {|m| "\"r#{$1}\":" + url_for(:controller => 'repositories', :action => 'revision', :id => @project.id, :rev => $1) } if @project # finally textilize text text = (Setting.text_formatting == 'textile') && (ActionView::Helpers::TextHelper.method_defined? "textilize") ? auto_link(RedCloth.new(text, [:filter_html]).to_html) : simple_format(auto_link(h(text))) |