@@ -511,17 +511,17 module ApplicationHelper | |||
|
511 | 511 | # Forum messages: |
|
512 | 512 | # message#1218 -> Link to message with id 1218 |
|
513 | 513 | text = text.gsub(%r{([\s\(,\-\>]|^)(!)?(attachment|document|version|commit|source|export|message|project)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]]\W)|,|\s|<|$)}) do |m| |
|
514 |
leading, esc, prefix, sep, |
|
|
514 | leading, esc, prefix, sep, identifier = $1, $2, $3, $5 || $7, $6 || $8 | |
|
515 | 515 | link = nil |
|
516 | 516 | if esc.nil? |
|
517 | 517 | if prefix.nil? && sep == 'r' |
|
518 |
if project && (changeset = project.changesets.find_by_revision( |
|
|
519 |
link = link_to("r#{ |
|
|
518 | if project && (changeset = project.changesets.find_by_revision(identifier)) | |
|
519 | link = link_to("r#{identifier}", {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :rev => changeset.revision}, | |
|
520 | 520 | :class => 'changeset', |
|
521 | 521 | :title => truncate_single_line(changeset.comments, :length => 100)) |
|
522 | 522 | end |
|
523 | 523 | elsif sep == '#' |
|
524 |
oid = |
|
|
524 | oid = identifier.to_i | |
|
525 | 525 | case prefix |
|
526 | 526 | when nil |
|
527 | 527 | if issue = Issue.visible.find_by_id(oid, :include => :status) |
@@ -557,7 +557,7 module ApplicationHelper | |||
|
557 | 557 | end |
|
558 | 558 | elsif sep == ':' |
|
559 | 559 | # removes the double quotes if any |
|
560 |
name = |
|
|
560 | name = identifier.gsub(%r{^"(.*)"$}, "\\1") | |
|
561 | 561 | case prefix |
|
562 | 562 | when 'document' |
|
563 | 563 | if project && document = project.documents.find_by_title(name) |
@@ -599,7 +599,7 module ApplicationHelper | |||
|
599 | 599 | end |
|
600 | 600 | end |
|
601 | 601 | end |
|
602 |
leading + (link || "#{prefix}#{sep}#{ |
|
|
602 | leading + (link || "#{prefix}#{sep}#{identifier}") | |
|
603 | 603 | end |
|
604 | 604 | |
|
605 | 605 | text |
General Comments 0
You need to be logged in to leave comments.
Login now