##// END OF EJS Templates
Do not require a non-word character after a comma in Redmine links (#3561)....
Jean-Philippe Lang -
r2704:da22a9c8d653
parent child
Show More
@@ -441,7 +441,7 module ApplicationHelper
441 441 # export:some/file -> Force the download of the file
442 442 # Forum messages:
443 443 # message#1218 -> Link to message with id 1218
444 text = text.gsub(%r{([\s\(,\-\>]|^)(!)?(attachment|document|version|commit|source|export|message)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]]\W)|\s|<|$)}) do |m|
444 text = text.gsub(%r{([\s\(,\-\>]|^)(!)?(attachment|document|version|commit|source|export|message)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]]\W)|,|\s|<|$)}) do |m|
445 445 leading, esc, prefix, sep, oid = $1, $2, $3, $5 || $7, $6 || $8
446 446 link = nil
447 447 if esc.nil?
@@ -124,6 +124,8 class ApplicationHelperTest < HelperTestCase
124 124
125 125 changeset_link = link_to('r1', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 1},
126 126 :class => 'changeset', :title => 'My very first commit')
127 changeset_link2 = link_to('r2', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 2},
128 :class => 'changeset', :title => 'This commit fixes #1, #2 and references #1 & #3')
127 129
128 130 document_link = link_to('Test document', {:controller => 'documents', :action => 'show', :id => 1},
129 131 :class => 'document')
@@ -141,6 +143,9 class ApplicationHelperTest < HelperTestCase
141 143 '#3, #3 and #3.' => "#{issue_link}, #{issue_link} and #{issue_link}.",
142 144 # changesets
143 145 'r1' => changeset_link,
146 'r1.' => "#{changeset_link}.",
147 'r1, r2' => "#{changeset_link}, #{changeset_link2}",
148 'r1,r2' => "#{changeset_link},#{changeset_link2}",
144 149 # documents
145 150 'document#1' => document_link,
146 151 'document:"Test document"' => document_link,
General Comments 0
You need to be logged in to leave comments. Login now