Project

General

Profile

Defect #1843 » defect-1843-r3.patch

Patch based on 0.7.3 - Daniel Feliciano Branco, 2008-11-17 15:13

View differences:

migrate_from_trac.rake 2008-11-17 11:35:19.000000000 +0000
232 232
        text = text.gsub(/^(\=+)\s(.+)\s(\=+)/) {|s| "\nh#{$1.length}. #{$2}\n"}
233 233
        # External Links
234 234
        text = text.gsub(/\[(http[^\s]+)\s+([^\]]+)\]/) {|s| "\"#{$2}\":#{$1}"}
235

  
236
        # Special cases like [wiki:"TextXXX"] or [wiki:"This is a page"]
237
        text = text.gsub(/\[wiki\:"([^\"]+)\"\]/)  {|s| "[[#{$1.delete(',./?;|:')}]]"}
238
        text = text.gsub(/\[wiki\:"([^\"]+)\" "([^\"]+)\"\]/) {|s| "[[#{$1.delete(',./?;|:"')}|#{$2.delete('",./?;|:')}]]"}
239

  
235 240
        # Internal Links
236 241
        text = text.gsub(/\[\[BR\]\]/, "\n") # This has to go before the rules below
237 242
        text = text.gsub(/\[\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
238 243
        text = text.gsub(/\[wiki:\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
239
        text = text.gsub(/\[wiki:\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
240 244
        text = text.gsub(/\[wiki:([^\s\]]+)\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
241 245
        text = text.gsub(/\[wiki:([^\s\]]+)\s(.*)\]/) {|s| "[[#{$1.delete(',./?;|:')}|#{$2.delete(',./?;|:')}]]"}
242 246

  
243
	# Links to pages UsingJustWikiCaps
244
	text = text.gsub(/([^!]|^)(^| )([A-Z][a-z]+[A-Z][a-zA-Z]+)/, '\\1\\2[[\3]]')
245
	# Normalize things that were supposed to not be links
246
	# like !NotALink
247
	text = text.gsub(/(^| )!([A-Z][A-Za-z]+)/, '\1\2')
247
        # Links to pages UsingJustWikiCaps
248
        text = text.gsub(/([^!]|^)(^| )((\[\[.+\]\]))([A-Z][a-z]+[A-Z][a-zA-Z]+)/, '\\1\\2[[\3]]')
249
        # Normalize things that were supposed to not be links
250
        # like !NotALink
251
	      text = text.gsub(/(^| )!([A-Z][A-Za-z]+)/, '\1\2')
248 252
        # Revisions links
249 253
        text = text.gsub(/\[(\d+)\]/, 'r\1')
250 254
        # Ticket number re-writing
(4-4/4)