Project

General

Profile

Defect #1612 » repo_links.patch

patch against current stable 0.7.3 - Paul Rivier, 2008-07-10 15:16

View differences:

app/helpers/application_helper.rb Thu Jul 10 13:22:44 2008 +0200 → app/helpers/application_helper.rb Thu Jul 10 15:09:15 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 Thu Jul 10 13:22:44 2008 +0200 → test/unit/helpers/application_helper_test.rb Thu Jul 10 15:09:15 2008 +0200
94 94
      'version:"1.0"'               => version_link,
95 95
      # source
96 96
      'source:/some/file'           => link_to('source:/some/file', source_url, :class => 'source'),
97
      'source:/some/file.'           => link_to('source:/some/file', source_url, :class => 'source') + ".",
98
      'source:/some/file. '           => link_to('source:/some/file', source_url, :class => 'source') + ".",
99
      'source:/some/file, '           => link_to('source:/some/file', source_url, :class => 'source') + ",",
97 100
      'source:/some/file@52'        => link_to('source:/some/file@52', source_url.merge(:rev => 52), :class => 'source'),
98 101
      'source:/some/file#L110'      => link_to('source:/some/file#L110', source_url.merge(:anchor => 'L110'), :class => 'source'),
99 102
      'source:/some/file@52#L110'   => link_to('source:/some/file@52#L110', source_url.merge(:rev => 52, :anchor => 'L110'), :class => 'source'),
(1-1/2)