@@ -287,7 +287,7 module ApplicationHelper | |||||
287 | # source:some/file#L120 -> Link to line 120 of the file |
|
287 | # source:some/file#L120 -> Link to line 120 of the file | |
288 | # source:some/file@52#L120 -> Link to line 120 of the file's revision 52 |
|
288 | # source:some/file@52#L120 -> Link to line 120 of the file's revision 52 | |
289 | # export:some/file -> Force the download of the file |
|
289 | # export:some/file -> Force the download of the file | |
290 |
text = text.gsub(%r{([\s\(,-^])(!)?(attachment|document|version|commit|source|export)?((#|r)(\d+)|(:)([^" |
|
290 | text = text.gsub(%r{([\s\(,-^])(!)?(attachment|document|version|commit|source|export)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*|"[^"]+"))(?=[[:punct:]]|\s|<|$)}) do |m| | |
291 | leading, esc, prefix, sep, oid = $1, $2, $3, $5 || $7, $6 || $8 |
|
291 | leading, esc, prefix, sep, oid = $1, $2, $3, $5 || $7, $6 || $8 | |
292 | link = nil |
|
292 | link = nil | |
293 | if esc.nil? |
|
293 | if esc.nil? |
@@ -105,6 +105,8 class ApplicationHelperTest < HelperTestCase | |||||
105 | '!version:1.0' => 'version:1.0', |
|
105 | '!version:1.0' => 'version:1.0', | |
106 | '!version:"1.0"' => 'version:"1.0"', |
|
106 | '!version:"1.0"' => 'version:"1.0"', | |
107 | '!source:/some/file' => 'source:/some/file', |
|
107 | '!source:/some/file' => 'source:/some/file', | |
|
108 | # invalid expressions | |||
|
109 | 'source:' => 'source:' | |||
108 | } |
|
110 | } | |
109 | @project = Project.find(1) |
|
111 | @project = Project.find(1) | |
110 | to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } |
|
112 | to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } |
General Comments 0
You need to be logged in to leave comments.
Login now