@@ -298,7 +298,7 module ApplicationHelper | |||
|
298 | 298 | # source:some/file#L120 -> Link to line 120 of the file |
|
299 | 299 | # source:some/file@52#L120 -> Link to line 120 of the file's revision 52 |
|
300 | 300 | # export:some/file -> Force the download of the file |
|
301 |
text = text.gsub(%r{([\s\(, |
|
|
301 | text = text.gsub(%r{([\s\(,\-\>]|^)(!)?(attachment|document|version|commit|source|export)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*|"[^"]+"))(?=[[:punct:]]|\s|<|$)}) do |m| | |
|
302 | 302 | leading, esc, prefix, sep, oid = $1, $2, $3, $5 || $7, $6 || $8 |
|
303 | 303 | link = nil |
|
304 | 304 | if esc.nil? |
@@ -108,7 +108,9 class ApplicationHelperTest < HelperTestCase | |||
|
108 | 108 | '!version:"1.0"' => 'version:"1.0"', |
|
109 | 109 | '!source:/some/file' => 'source:/some/file', |
|
110 | 110 | # invalid expressions |
|
111 | 'source:' => 'source:' | |
|
111 | 'source:' => 'source:', | |
|
112 | # url hash | |
|
113 | "http://foo.bar/FAQ#3" => '<a class="external" href="http://foo.bar/FAQ#3">http://foo.bar/FAQ#3</a>', | |
|
112 | 114 | } |
|
113 | 115 | @project = Project.find(1) |
|
114 | 116 | 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