summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-11-11 13:28:13 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-11-11 13:28:13 +0000
commit1802fa9348eadf0c890996fbac6e8c6011c7d8e0 (patch)
tree53257ffd54bda04763179864653747b41894ab1a /lib
parent29bad1dc95d2a845317ec2e5bd6a02daefaf789c (diff)
downloadredmine-1802fa9348eadf0c890996fbac6e8c6011c7d8e0.tar.gz
redmine-1802fa9348eadf0c890996fbac6e8c6011c7d8e0.zip
Fixed: Trac migration of ticket:123 or [ticket:34] do not work (#2053).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2012 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/migrate_from_trac.rake7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/tasks/migrate_from_trac.rake b/lib/tasks/migrate_from_trac.rake
index a91a8d72b..fd53250b8 100644
--- a/lib/tasks/migrate_from_trac.rake
+++ b/lib/tasks/migrate_from_trac.rake
@@ -268,6 +268,13 @@ namespace :redmine do
text = text.gsub(/^(\=+)\s(.+)\s(\=+)/) {|s| "\nh#{$1.length}. #{$2}\n"}
# External Links
text = text.gsub(/\[(http[^\s]+)\s+([^\]]+)\]/) {|s| "\"#{$2}\":#{$1}"}
+ # Situations like the following:
+ # [ticket:234 Text],[ticket:234 This is a test]
+ text = text.gsub(/\[ticket\:([^\ ]+)\ (.+?)\]/, '[[#\1|\2]]')
+ # Situations like:
+ # ticket:1234
+ # #1 is working cause Redmine uses the same syntax.
+ text = text.gsub(/ticket\:([^\ ]+)/, '#\1')
# Internal Links
text = text.gsub(/\[\[BR\]\]/, "\n") # This has to go before the rules below
text = text.gsub(/\[\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}