]> source.dussan.org Git - redmine.git/commitdiff
"#id" patterns are turned into links to issues in descriptions and commit messages
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 25 Feb 2007 19:40:57 +0000 (19:40 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 25 Feb 2007 19:40:57 +0000 (19:40 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@274 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb

index 748a1d7e912d15fdff034d5bcf7539b980a4dd00..113b1d3956b5470777b12054ed6cdd433dbda2a0 100644 (file)
@@ -93,7 +93,9 @@ module ApplicationHelper
   end\r
   \r
   def textilizable(text)\r
-    (Setting.text_formatting == 'textile') && (ActionView::Helpers::TextHelper.method_defined? "textilize") ? RedCloth.new(h(text)).to_html : simple_format(auto_link(h(text)))\r
+    text = (Setting.text_formatting == 'textile') && (ActionView::Helpers::TextHelper.method_defined? "textilize") ? RedCloth.new(h(text)).to_html : simple_format(auto_link(h(text)))\r
+    # turn "#id" patterns into links to issues\r
+    text = text.gsub(/#(\d+)([^;\d])/, "<a href='/issues/show/\\1'>#\\1</a>\\2")\r
   end\r
   \r
   def error_messages_for(object_name, options = {})\r