diff options
author | John Goerzen <jgoerzen@complete.org> | 2008-03-13 05:48:37 +0000 |
---|---|---|
committer | John Goerzen <jgoerzen@complete.org> | 2008-03-13 05:48:37 +0000 |
commit | 87fb78be0b48fb86ce1cc823f836ffe5a7bf3ad2 (patch) | |
tree | 02fb7a170c49822c9f624e5d130c42ab6967fad3 | |
parent | eafaae73b75fefd91891d990efe91b908db43e36 (diff) | |
download | redmine-87fb78be0b48fb86ce1cc823f836ffe5a7bf3ad2.tar.gz redmine-87fb78be0b48fb86ce1cc823f836ffe5a7bf3ad2.zip |
Support WikiCaps for Trac migrations
Trac wikis support WikiCaps for links to pages. They also use
!WikiCaps syntax to prevent links. Support both.
Uses patch from and closes #758.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1242 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | lib/tasks/migrate_from_trac.rake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/tasks/migrate_from_trac.rake b/lib/tasks/migrate_from_trac.rake index 9ece2cf39..b07be03b8 100644 --- a/lib/tasks/migrate_from_trac.rake +++ b/lib/tasks/migrate_from_trac.rake @@ -216,6 +216,12 @@ namespace :redmine do text = text.gsub(/\[wiki:\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"} text = text.gsub(/\[wiki:\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"} text = text.gsub(/\[wiki:([^\s\]]+).*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"} + + # Links to pages UsingJustCaps + text = text.gsub(/[^!]\b([A-Z][a-z]+[A-Z][a-zA-Z]+)/, '[[\1]]') + # Normalize things that were supposed to not be links + # like !NotALink + text = text.gsub(/(^| )!([A-Z][A-Za-z]+)/, '\1\2') # Revisions links text = text.gsub(/\[(\d+)\]/, 'r\1') # Ticket number re-writing |