OSDN Git Service

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 8072fea..3e07847 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")