diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-02-25 19:40:57 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-02-25 19:40:57 +0000 |
commit | 2e31311e3c9d00030ae295fcbab52ae4d7bb7225 (patch) | |
tree | d6f972db8a40e4ee02abedeffe62bd13b3a528bf /app | |
parent | 32782a7f9fd4e7a1f4cc8ce2c72d3257dec23d52 (diff) | |
download | redmine-2e31311e3c9d00030ae295fcbab52ae4d7bb7225.tar.gz redmine-2e31311e3c9d00030ae295fcbab52ae4d7bb7225.zip |
"#id" patterns are turned into links to issues in descriptions and commit messages
git-svn-id: http://redmine.rubyforge.org/svn/trunk@274 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/application_helper.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 748a1d7e9..113b1d395 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -93,7 +93,9 @@ module ApplicationHelper end
def textilizable(text)
- (Setting.text_formatting == 'textile') && (ActionView::Helpers::TextHelper.method_defined? "textilize") ? RedCloth.new(h(text)).to_html : simple_format(auto_link(h(text)))
+ text = (Setting.text_formatting == 'textile') && (ActionView::Helpers::TextHelper.method_defined? "textilize") ? RedCloth.new(h(text)).to_html : simple_format(auto_link(h(text)))
+ # turn "#id" patterns into links to issues
+ text = text.gsub(/#(\d+)([^;\d])/, "<a href='/issues/show/\\1'>#\\1</a>\\2")
end
def error_messages_for(object_name, options = {})
|