[Rt-commit] rt branch, 4.2/show-cf-wikitext-callback, created. rt-4.2.12-98-gc9f6934

Dustin Graves dustin at bestpractical.com
Mon May 16 18:10:24 EDT 2016


The branch, 4.2/show-cf-wikitext-callback has been created
        at  c9f6934f8fd23a79ad2e4643a95b7428d51025f2 (commit)

- Log -----------------------------------------------------------------
commit c9f6934f8fd23a79ad2e4643a95b7428d51025f2
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Mon May 16 22:09:49 2016 +0000

    add callback to modify arguments to Text::WikiFormat::format when rendering wikitext custom field

diff --git a/share/html/Elements/ShowCustomFieldWikitext b/share/html/Elements/ShowCustomFieldWikitext
index fe4fee8..8d4cb55 100644
--- a/share/html/Elements/ShowCustomFieldWikitext
+++ b/share/html/Elements/ShowCustomFieldWikitext
@@ -45,13 +45,21 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-% my $content = $Object->LargeContent || $Object->Content;
-% $content = $m->comp('/Elements/ScrubHTML', Content => $content);
-% my $base = $Object->Object->WikiBase;
-% my $wiki_content = Text::WikiFormat::format( $content."\n" , {}, { extended => 1,  absolute_links => 1, implicit_links => RT->Config->Get('WikiImplicitLinks'), prefix => $base} );
 <%$wiki_content|n%>
 <%init>
+my $content = $Object->LargeContent || $Object->Content;
+$content = $m->comp('/Elements/ScrubHTML', Content => $content);
+my $base = $Object->Object->WikiBase;
+my %wiki_args = (
+    extended => 1,
+    absolute_links => 1,
+    implicit_links => RT->Config->Get('WikiImplicitLinks'),
+    prefix => $base,
+);
+$m->callback( CallbackName => 'WikiFormatArgs', WikiArgsRef => \%wiki_args );
+
 use Text::WikiFormat;
+my $wiki_content = Text::WikiFormat::format( $content."\n" , {}, { %wiki_args } );
 </%init>
 <%ARGS>
 $Object

-----------------------------------------------------------------------


More information about the rt-commit mailing list