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
This commit is contained in:
Jean-Philippe Lang 2008-11-11 13:28:13 +00:00
parent 29bad1dc95
commit 1802fa9348
1 changed files with 7 additions and 0 deletions

View File

@ -268,6 +268,13 @@ namespace :redmine do
text = text.gsub(/^(\=+)\s(.+)\s(\=+)/) {|s| "\nh#{$1.length}. #{$2}\n"} text = text.gsub(/^(\=+)\s(.+)\s(\=+)/) {|s| "\nh#{$1.length}. #{$2}\n"}
# External Links # External Links
text = text.gsub(/\[(http[^\s]+)\s+([^\]]+)\]/) {|s| "\"#{$2}\":#{$1}"} 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 # Internal Links
text = text.gsub(/\[\[BR\]\]/, "\n") # This has to go before the rules below text = text.gsub(/\[\[BR\]\]/, "\n") # This has to go before the rules below
text = text.gsub(/\[\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"} text = text.gsub(/\[\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}