@@ -441,7 +441,7 module ApplicationHelper | |||||
441 | # export:some/file -> Force the download of the file |
|
441 | # export:some/file -> Force the download of the file | |
442 | # Forum messages: |
|
442 | # Forum messages: | |
443 | # message#1218 -> Link to message with id 1218 |
|
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 | leading, esc, prefix, sep, oid = $1, $2, $3, $5 || $7, $6 || $8 |
|
445 | leading, esc, prefix, sep, oid = $1, $2, $3, $5 || $7, $6 || $8 | |
446 | link = nil |
|
446 | link = nil | |
447 | if esc.nil? |
|
447 | if esc.nil? |
@@ -124,6 +124,8 class ApplicationHelperTest < HelperTestCase | |||||
124 |
|
124 | |||
125 | changeset_link = link_to('r1', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 1}, |
|
125 | changeset_link = link_to('r1', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 1}, | |
126 | :class => 'changeset', :title => 'My very first commit') |
|
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 | document_link = link_to('Test document', {:controller => 'documents', :action => 'show', :id => 1}, |
|
130 | document_link = link_to('Test document', {:controller => 'documents', :action => 'show', :id => 1}, | |
129 | :class => 'document') |
|
131 | :class => 'document') | |
@@ -141,6 +143,9 class ApplicationHelperTest < HelperTestCase | |||||
141 | '#3, #3 and #3.' => "#{issue_link}, #{issue_link} and #{issue_link}.", |
|
143 | '#3, #3 and #3.' => "#{issue_link}, #{issue_link} and #{issue_link}.", | |
142 | # changesets |
|
144 | # changesets | |
143 | 'r1' => changeset_link, |
|
145 | 'r1' => changeset_link, | |
|
146 | 'r1.' => "#{changeset_link}.", | |||
|
147 | 'r1, r2' => "#{changeset_link}, #{changeset_link2}", | |||
|
148 | 'r1,r2' => "#{changeset_link},#{changeset_link2}", | |||
144 | # documents |
|
149 | # documents | |
145 | 'document#1' => document_link, |
|
150 | 'document#1' => document_link, | |
146 | 'document:"Test document"' => document_link, |
|
151 | 'document:"Test document"' => document_link, |
General Comments 0
You need to be logged in to leave comments.
Login now