@@ -592,7 +592,7 module ApplicationHelper | |||||
592 | url_for(:only_path => only_path, :controller => 'wiki', :action => 'show', :project_id => link_project, :id => wiki_page_id, :anchor => anchor) |
|
592 | url_for(:only_path => only_path, :controller => 'wiki', :action => 'show', :project_id => link_project, :id => wiki_page_id, :anchor => anchor) | |
593 | end |
|
593 | end | |
594 | end |
|
594 | end | |
595 |
link_to |
|
595 | link_to(title || h(page), url, :class => ('wiki-page' + (wiki_page ? '' : ' new'))) | |
596 | else |
|
596 | else | |
597 | # project or wiki doesn't exist |
|
597 | # project or wiki doesn't exist | |
598 | all.html_safe |
|
598 | all.html_safe |
@@ -350,6 +350,9 RAW | |||||
350 | to_test = { |
|
350 | to_test = { | |
351 | '[[CookBook documentation]]' => '<a href="/projects/ecookbook/wiki/CookBook_documentation" class="wiki-page">CookBook documentation</a>', |
|
351 | '[[CookBook documentation]]' => '<a href="/projects/ecookbook/wiki/CookBook_documentation" class="wiki-page">CookBook documentation</a>', | |
352 | '[[Another page|Page]]' => '<a href="/projects/ecookbook/wiki/Another_page" class="wiki-page">Page</a>', |
|
352 | '[[Another page|Page]]' => '<a href="/projects/ecookbook/wiki/Another_page" class="wiki-page">Page</a>', | |
|
353 | # title content should be formatted | |||
|
354 | '[[Another page|With _styled_ *title*]]' => '<a href="/projects/ecookbook/wiki/Another_page" class="wiki-page">With <em>styled</em> <strong>title</strong></a>', | |||
|
355 | '[[Another page|With title containing <strong>HTML entities & markups</strong>]]' => '<a href="/projects/ecookbook/wiki/Another_page" class="wiki-page">With title containing <strong>HTML entities & markups</strong></a>', | |||
353 | # link with anchor |
|
356 | # link with anchor | |
354 | '[[CookBook documentation#One-section]]' => '<a href="/projects/ecookbook/wiki/CookBook_documentation#One-section" class="wiki-page">CookBook documentation</a>', |
|
357 | '[[CookBook documentation#One-section]]' => '<a href="/projects/ecookbook/wiki/CookBook_documentation#One-section" class="wiki-page">CookBook documentation</a>', | |
355 | '[[Another page#anchor|Page]]' => '<a href="/projects/ecookbook/wiki/Another_page#anchor" class="wiki-page">Page</a>', |
|
358 | '[[Another page#anchor|Page]]' => '<a href="/projects/ecookbook/wiki/Another_page#anchor" class="wiki-page">Page</a>', | |
@@ -371,6 +374,7 RAW | |||||
371 | '[[unknowproject:Start]]' => '[[unknowproject:Start]]', |
|
374 | '[[unknowproject:Start]]' => '[[unknowproject:Start]]', | |
372 | '[[unknowproject:Start|Page title]]' => '[[unknowproject:Start|Page title]]', |
|
375 | '[[unknowproject:Start|Page title]]' => '[[unknowproject:Start|Page title]]', | |
373 | } |
|
376 | } | |
|
377 | ||||
374 | @project = Project.find(1) |
|
378 | @project = Project.find(1) | |
375 | to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } |
|
379 | to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } | |
376 | end |
|
380 | end |
General Comments 0
You need to be logged in to leave comments.
Login now