From 0e0b8e0799695c631d7ececa23ce941701069a46 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 17 Mar 2010 19:57:32 +0000 Subject: [PATCH] Accept issue links inside brackets (#4418). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3598 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 2 +- test/unit/helpers/application_helper_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c490f2b1..760ac4f0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -541,7 +541,7 @@ module ApplicationHelper # Forum messages: # message#1218 -> Link to message with id 1218 def parse_redmine_links(text, project, obj, attr, only_path, options) - text.gsub!(%r{([\s\(,\-\>]|^)(!)?(attachment|document|version|commit|source|export|message|project)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]]\W)|,|\s|<|$)}) do |m| + text.gsub!(%r{([\s\(,\-\[\>]|^)(!)?(attachment|document|version|commit|source|export|message|project)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]]\W)|,|\s|\]|<|$)}) do |m| leading, esc, prefix, sep, identifier = $1, $2, $3, $5 || $7, $6 || $8 link = nil if esc.nil? diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 11bbe908..656d05f8 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -158,7 +158,7 @@ RAW to_test = { # tickets - '#3, #3 and #3.' => "#{issue_link}, #{issue_link} and #{issue_link}.", + '#3, [#3], (#3) and #3.' => "#{issue_link}, [#{issue_link}], (#{issue_link}) and #{issue_link}.", # changesets 'r1' => changeset_link, 'r1.' => "#{changeset_link}.",