Patch #2052 ยป milestone.patch
migrate_from_trac.rake (working copy) | ||
---|---|---|
260 | 260 |
text = text.gsub(/^(\=+)\s(.+)\s(\=+)/) {|s| "\nh#{$1.length}. #{$2}\n"} |
261 | 261 |
# External Links |
262 | 262 |
text = text.gsub(/\[(http[^\s]+)\s+([^\]]+)\]/) {|s| "\"#{$2}\":#{$1}"} |
263 | ||
264 |
# First Situation: |
|
265 |
# [milestone:"0.1.0 Mercury" Milestone 0.1.0 (Mercury)] |
|
266 |
# The text "Milestone 0.1.0 (Mercury)" is not converted, |
|
267 |
# cause Redmine's wiki does not support this. |
|
268 |
text = text.gsub(/\[milestone\:\"([^\"]+)\"\ (.+?)\]/, 'version:"\1"') |
|
269 | ||
270 |
# Second Situation: |
|
271 |
# [milestone:"0.1.0 Mercury"] |
|
272 |
text = text.gsub(/\[milestone\:\"([^\"]+)\"\]/, 'version:"\1"') |
|
273 |
text = text.gsub(/milestone\:\"([^\"]+)\"/, 'version:"\1"') |
|
274 |
|
|
275 |
# Third Situation: |
|
276 |
# milestone:0.1.0 |
|
277 |
text = text.gsub(/\[milestone\:([^\ ]+)\]/, 'version:\1') |
|
278 |
text = text.gsub(/milestone\:([^\ ]+)/, 'version:\1') |
|
279 | ||
263 | 280 |
# Internal Links |
264 | 281 |
text = text.gsub(/\[\[BR\]\]/, "\n") # This has to go before the rules below |
265 | 282 |
text = text.gsub(/\[\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"} |