]> source.dussan.org Git - redmine.git/commitdiff
Fixed 10031 revision links and auto linking URLs conflict
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 11 Apr 2007 15:10:02 +0000 (15:10 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 11 Apr 2007 15:10:02 +0000 (15:10 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@440 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb

index 8072feae1c95c64c33077a22c5467e0703b6129e..3e078475d8aeef369aab724f7bc05d178e8614e2 100644 (file)
@@ -135,7 +135,7 @@ module ApplicationHelper
     # 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+)(?=\b)/) {|m| "\"r#{$1}\":" + url_for(:controller => 'repositories', :action => 'revision', :id => @project.id, :rev => $1) } if @project
+    text = text.gsub(/(?=\b)r(\d+)(?=\b)/) {|m| "\"r#{$1}\":" + url_for(: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")