Commit 609fd126 authored by jgoerzen's avatar jgoerzen

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: https://svn.redmine.org/redmine/trunk@1242 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent edcc6599
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment