Feature #3844

Allow custom Proc to render wiki_links

Added by David Escala over 8 years ago. Updated about 5 years ago.

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

0%

Category:-
Target version:-
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

History

#1 Updated by David Escala about 5 years ago

  • Status changed from New to Resolved

#2 Updated by Etienne Massip about 5 years ago

  • Status changed from Resolved to Closed

Thanks for your feedback!

Also available in: Atom PDF