Project

General

Profile

Actions

Feature #3844

closed

Allow custom Proc to render wiki_links

Added by David Escala about 15 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2009-09-10
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

I am writing a Redmine plugin to use the wiki module as a content source for other pages. It needs is a way to tell textilizable to format links in specific ways. Current options for :wiki_links are :local, :anchor and the default wiki links.

I propose to allow a custom Proc in :wiki_link with this simple patch:

--- app/helpers/application_helper.rb   (revision 2859)
+++ app/helpers/application_helper.rb   (working copy)
@@ -370,6 +370,9 @@
     when :anchor
       # used for single-file wiki export
       format_wiki_link = Proc.new {|project, title, anchor| "##{title}" }
+    when Proc
+      # custom proc
+      format_wiki_link = options[:wiki_links]
     else
       format_wiki_link = Proc.new {|project, title, anchor| url_for(:only_path => only_path, :controller => 'wiki', :action => 'index', :id => project, :page => title, :anchor => anchor) }
     end
Actions

Also available in: Atom PDF