non-greedy.patch

Patch based on Revision 1941 (trunk) - Karl Heinz Marbaise, 2008-10-19 16:54

Download (1.3 KB)

View differences:

migrate_from_trac.rake (working copy)
262 262
        text = text.gsub(/\[(http[^\s]+)\s+([^\]]+)\]/) {|s| "\"#{$2}\":#{$1}"}
263 263
        # Internal Links
264 264
        text = text.gsub(/\[\[BR\]\]/, "\n") # This has to go before the rules below
265
        text = text.gsub(/\[\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
266
        text = text.gsub(/\[wiki:\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
267
        text = text.gsub(/\[wiki:\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
265
        text = text.gsub(/\[\"(.+)\".*?\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
266
        text = text.gsub(/\[wiki:\"(.+)\".*?\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
267
        text = text.gsub(/\[wiki:\"(.+)\".*?\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
268 268
        text = text.gsub(/\[wiki:([^\s\]]+)\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
269
        text = text.gsub(/\[wiki:([^\s\]]+)\s(.*)\]/) {|s| "[[#{$1.delete(',./?;|:')}|#{$2.delete(',./?;|:')}]]"}
269
        text = text.gsub(/\[wiki:([^\s\]]+)\s(.*?)\]/) {|s| "[[#{$1.delete(',./?;|:')}|#{$2.delete(',./?;|:')}]]"}
270 270

  
271 271
	# Links to pages UsingJustWikiCaps
272 272
	text = text.gsub(/([^!]|^)(^| )([A-Z][a-z]+[A-Z][a-zA-Z]+)/, '\\1\\2[[\3]]')