Feature #3844

Allow custom Proc to render wiki_links

Added by David Escala almost 10 years ago. Updated over 6 years ago.

Status:ClosedStart date:2009-09-10
Priority:NormalDue date:
Assignee:-% Done:


Target version:-


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]
       format_wiki_link = Proc.new {|project, title, anchor| url_for(:only_path => only_path, :controller => 'wiki', :action => 'index', :id => project, :page => title, :anchor => anchor) }


#1 Updated by David Escala over 6 years ago

  • Status changed from New to Resolved

#2 Updated by Etienne Massip over 6 years ago

  • Status changed from Resolved to Closed

Thanks for your feedback!

Also available in: Atom PDF