summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-17 12:06:50 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-17 12:06:50 +0000
commitd1780270da6bc7926480cb1f9b82412583f13183 (patch)
tree470a836de5b803b7c9c92353b472ccecf58cd2b3 /app
parent00238738b190bfbe30d5b3ee2e1438837343d10a (diff)
downloadredmine-d1780270da6bc7926480cb1f9b82412583f13183.tar.gz
redmine-d1780270da6bc7926480cb1f9b82412583f13183.zip
Small change to ApplicationHelper#textilizable to allow links to other wikis main page with custom text (eg. project:|mytext).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@653 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/helpers/application_helper.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 1a59f5460..41becd0f2 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -147,6 +147,7 @@ module ApplicationHelper
# [[mypage|mytext]]
# wiki links can refer other project wikis, using project name or identifier:
# [[project:]] -> wiki starting page
+ # [[project:|mytext]]
# [[project:mypage]]
# [[project:mypage|mytext]]
text = text.gsub(/\[\[([^\]\|]+)(\|([^\]\|]+))?\]\]/) do |m|
@@ -155,7 +156,7 @@ module ApplicationHelper
title = $3
if page =~ /^([^\:]+)\:(.*)$/
link_project = Project.find_by_name($1) || Project.find_by_identifier($1)
- page = $2
+ page = title || $2
title = $1 if page.blank?
end
link_to((title || page), format_wiki_link.call(link_project, Wiki.titleize(page)), :class => 'wiki-page')