From d1780270da6bc7926480cb1f9b82412583f13183 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 17 Aug 2007 12:06:50 +0000 Subject: [PATCH] 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 --- app/helpers/application_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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')