Project

General

Profile

Actions

Feature #3844

closed

Allow custom Proc to render wiki_links

Added by David Escala over 14 years ago. Updated over 11 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 #1

Updated by David Escala over 11 years ago

  • Status changed from New to Resolved
Actions #2

Updated by Etienne Massip over 11 years ago

  • Status changed from Resolved to Closed

Thanks for your feedback!

Actions

Also available in: Atom PDF