@@ -268,13 +268,23 namespace :redmine do | |||||
268 | text = text.gsub(/^(\=+)\s(.+)\s(\=+)/) {|s| "\nh#{$1.length}. #{$2}\n"} |
|
268 | text = text.gsub(/^(\=+)\s(.+)\s(\=+)/) {|s| "\nh#{$1.length}. #{$2}\n"} | |
269 | # External Links |
|
269 | # External Links | |
270 | text = text.gsub(/\[(http[^\s]+)\s+([^\]]+)\]/) {|s| "\"#{$2}\":#{$1}"} |
|
270 | text = text.gsub(/\[(http[^\s]+)\s+([^\]]+)\]/) {|s| "\"#{$2}\":#{$1}"} | |
271 | # Situations like the following: |
|
271 | # Ticket links: | |
272 | # [ticket:234 Text],[ticket:234 This is a test] |
|
272 | # [ticket:234 Text],[ticket:234 This is a test] | |
273 | text = text.gsub(/\[ticket\:([^\ ]+)\ (.+?)\]/, '"\2":/issues/show/\1') |
|
273 | text = text.gsub(/\[ticket\:([^\ ]+)\ (.+?)\]/, '"\2":/issues/show/\1') | |
274 | # Situations like: |
|
|||
275 | # ticket:1234 |
|
274 | # ticket:1234 | |
276 | # #1 is working cause Redmine uses the same syntax. |
|
275 | # #1 is working cause Redmine uses the same syntax. | |
277 | text = text.gsub(/ticket\:([^\ ]+)/, '#\1') |
|
276 | text = text.gsub(/ticket\:([^\ ]+)/, '#\1') | |
|
277 | # Milestone links: | |||
|
278 | # [milestone:"0.1.0 Mercury" Milestone 0.1.0 (Mercury)] | |||
|
279 | # The text "Milestone 0.1.0 (Mercury)" is not converted, | |||
|
280 | # cause Redmine's wiki does not support this. | |||
|
281 | text = text.gsub(/\[milestone\:\"([^\"]+)\"\ (.+?)\]/, 'version:"\1"') | |||
|
282 | # [milestone:"0.1.0 Mercury"] | |||
|
283 | text = text.gsub(/\[milestone\:\"([^\"]+)\"\]/, 'version:"\1"') | |||
|
284 | text = text.gsub(/milestone\:\"([^\"]+)\"/, 'version:"\1"') | |||
|
285 | # milestone:0.1.0 | |||
|
286 | text = text.gsub(/\[milestone\:([^\ ]+)\]/, 'version:\1') | |||
|
287 | text = text.gsub(/milestone\:([^\ ]+)/, 'version:\1') | |||
278 | # Internal Links |
|
288 | # Internal Links | |
279 | text = text.gsub(/\[\[BR\]\]/, "\n") # This has to go before the rules below |
|
289 | text = text.gsub(/\[\[BR\]\]/, "\n") # This has to go before the rules below | |
280 | text = text.gsub(/\[\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"} |
|
290 | text = text.gsub(/\[\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"} |
General Comments 0
You need to be logged in to leave comments.
Login now