Defect #1612 » repo_link.patch
app/helpers/application_helper.rb Wed Jul 09 19:25:19 2008 +0200 → app/helpers/application_helper.rb Thu Jul 10 15:12:44 2008 +0200 | ||
---|---|---|
298 | 298 |
# source:some/file#L120 -> Link to line 120 of the file |
299 | 299 |
# source:some/file@52#L120 -> Link to line 120 of the file's revision 52 |
300 | 300 |
# export:some/file -> Force the download of the file |
301 |
text = text.gsub(%r{([\s\(,\-\>]|^)(!)?(attachment|document|version|commit|source|export)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*|"[^"]+"))(?=[[:punct:]]|\s|<|$)}) do |m|
|
|
301 |
text = text.gsub(%r{([\s\(,\-\>]|^)(!)?(attachment|document|version|commit|source|export)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]]\W)|\s|<|$)}) do |m|
|
|
302 | 302 |
leading, esc, prefix, sep, oid = $1, $2, $3, $5 || $7, $6 || $8 |
303 | 303 |
link = nil |
304 | 304 |
if esc.nil? |
test/unit/helpers/application_helper_test.rb Wed Jul 09 19:25:19 2008 +0200 → test/unit/helpers/application_helper_test.rb Thu Jul 10 15:12:44 2008 +0200 | ||
---|---|---|
97 | 97 |
'version:"1.0"' => version_link, |
98 | 98 |
# source |
99 | 99 |
'source:/some/file' => link_to('source:/some/file', source_url, :class => 'source'), |
100 |
'source:/some/file.' => link_to('source:/some/file', source_url, :class => 'source') + ".", |
|
101 |
'source:/some/file. ' => link_to('source:/some/file', source_url, :class => 'source') + ".", |
|
102 |
'source:/some/file, ' => link_to('source:/some/file', source_url, :class => 'source') + ",", |
|
100 | 103 |
'source:/some/file@52' => link_to('source:/some/file@52', source_url.merge(:rev => 52), :class => 'source'), |
101 | 104 |
'source:/some/file#L110' => link_to('source:/some/file#L110', source_url.merge(:anchor => 'L110'), :class => 'source'), |
102 | 105 |
'source:/some/file@52#L110' => link_to('source:/some/file@52#L110', source_url.merge(:rev => 52, :anchor => 'L110'), :class => 'source'), |
- « Previous
- 1
- 2
- Next »