From 1032210edd00cf0a9604d91235166ea38fbf1bc0 Mon Sep 17 00:00:00 2001 From: Etienne Massip Date: Sat, 29 Oct 2011 11:45:59 +0000 Subject: [PATCH] Don't escape already parsed wiki link title (#9471). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7698 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 2 +- test/unit/helpers/application_helper_test.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c6d57ade9..73d62ca77 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -592,7 +592,7 @@ module ApplicationHelper url_for(:only_path => only_path, :controller => 'wiki', :action => 'show', :project_id => link_project, :id => wiki_page_id, :anchor => anchor) end end - link_to(h(title || page), url, :class => ('wiki-page' + (wiki_page ? '' : ' new'))) + link_to(title || h(page), url, :class => ('wiki-page' + (wiki_page ? '' : ' new'))) else # project or wiki doesn't exist all.html_safe diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index c87210155..5806b7224 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -350,6 +350,9 @@ RAW to_test = { '[[CookBook documentation]]' => 'CookBook documentation', '[[Another page|Page]]' => 'Page', + # title content should be formatted + '[[Another page|With _styled_ *title*]]' => 'With styled title', + '[[Another page|With title containing HTML entities & markups]]' => 'With title containing <strong>HTML entities & markups</strong>', # link with anchor '[[CookBook documentation#One-section]]' => 'CookBook documentation', '[[Another page#anchor|Page]]' => 'Page', @@ -371,6 +374,7 @@ RAW '[[unknowproject:Start]]' => '[[unknowproject:Start]]', '[[unknowproject:Start|Page title]]' => '[[unknowproject:Start|Page title]]', } + @project = Project.find(1) to_test.each { |text, result| assert_equal "

#{result}

", textilizable(text) } end