<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Also tried the following:<div><br></div><div><div> $actions->{'bold_text'} = sub {</div><div> my %args = @_;</div><div> my $id = $args{'all_matches'}[1];</div><div> return qq{<b>$id<b>};</div><div> };</div><div><br></div><div><div> push @$types, {</div><div> # name, that should be used in config to activate action</div><div> name => 'bold_text',</div><div> # regular expression that matches text 'ticket #xxx'</div><div> regex => qr{\[b\](.*)\[\/b\]}i,</div><div> # name of the action that should be applied</div><div> action => 'bold_text',</div><div> };</div><div><br></div></div><div apple-content-edited="true"> <span class="Apple-style-span" style="font-size: 12px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>In this case</div><div><br></div><div><span class="Apple-style-span" style="font-size: medium; "><div> return qq{<b>$id<b>};</div><div><br></div><div>gives nothing</div><div><br></div><div><div> return qq{<b>$args{value}<b>};</div><div><br></div><div>returns the whole pattern matched (which obviously I don't want as I want to strip the [b][/b] tags off).</div><div><br></div><div>So it really looks like $args{'all_matches'}[1]; etc doesn't get populated with the sub-matches in a regex like qr{\[b\](.*)\[\/b\]}i,</div><div><br></div><div>I would expect [1] to contain the stuff in the (.*) sub-match (unless the example I'm basing mine on is wrong and I'm doing something stupid)</div><div><br></div><div>Justin</div></div></span>-------------------------------------------------</div><div>Justin Hayes</div><div>Orbis Support Manager</div><div><a href="mailto:justin.hayes@orbisuk.com">justin.hayes@orbisuk.com</a></div><div><br></div></div></span><br class="Apple-interchange-newline"><br class="Apple-interchange-newline"> </div><br><div><div>On 14 Jul 2009, at 18:12, Justin Hayes wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi,</div><div><br></div><div>Has anyone tried the example MakeClicky Callback in the docs (<span class="Apple-style-span" style="font-family: 'Lucida Grande'; font-size: 12px; ">extending_clickable_links.pod)?</span></div><div><br></div><div><span class="Apple-style-span" style="font-family: 'Lucida Grande'; font-size: 12px; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">I've added the following as a callback as it says :</span></span></div><div><br></div><div> <%ARGS></div><div> $types => []</div><div> $actions => {}</div><div> </%ARGS></div><div> <%INIT></div><div> my $web_path = RT->Config->Get('WebPath');</div><div><br></div><div> # action that takes ticket ID as argument and returns link to the ticket</div><div> $actions->{'link_ticket'} = sub {</div><div> my %args = @_;</div><div> my $id = $args{'all_matches'}[1];</div><div> return qq{<a href="$web_path/Ticket/Display.html?id=$id">$args{value}</a>};</div><div> };</div><div><br></div><div> # add action to the list</div><div> push @$types, {</div><div> # name, that should be used in config to activate action</div><div> name => 'short_ticket_link',</div><div> # regular expression that matches text 'ticket #xxx'</div><div> regex => qr{ticket\s+#(\d+)}i,</div><div> # name of the action that should be applied</div><div> action => 'link_ticket',</div><div> };</div><div> </%INIT></div><div><br></div><div apple-content-edited="true"> <span class="Apple-style-span" style="font-size: 12px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>It definitely does something, as my Ticket #1 text becomes clickable, however it links to a Display.html url with no ticket id</div><div><br></div><div>Ticket/Display.html?id=</div><div><br></div><div>I guess the <span class="Apple-style-span" style="font-size: medium; "> my $id = $args{'all_matches'}[1];</span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-size: medium;">b</span><span class="Apple-style-span" style="font-size: medium;">i</span><span class="Apple-style-span" style="font-size: medium;">t</span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-size: medium;">j</span><span class="Apple-style-span" style="font-size: medium;">u</span><span class="Apple-style-span" style="font-size: medium;">s</span><span class="Apple-style-span" style="font-size: medium;">t</span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-size: medium;">d</span><span class="Apple-style-span" style="font-size: medium;">o</span><span class="Apple-style-span" style="font-size: medium;">e</span><span class="Apple-style-span" style="font-size: medium;">s</span><span class="Apple-style-span" style="font-size: medium;">n</span><span class="Apple-style-span" style="font-size: medium;">'</span><span class="Apple-style-span" style="font-size: medium;">t</span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-size: medium;">h</span><span class="Apple-style-span" style="font-size: medium;">a</span><span class="Apple-style-span" style="font-size: medium;">v</span><span class="Apple-style-span" style="font-size: medium;">e</span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-size: medium;">a</span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-size: medium;">v</span><span class="Apple-style-span" style="font-size: medium;">a</span><span class="Apple-style-span" style="font-size: medium;">l</span><span class="Apple-style-span" style="font-size: medium;">u</span><span class="Apple-style-span" style="font-size: medium;">e</span><span class="Apple-style-span" style="font-size: medium;">,</span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-size: medium;">b</span><span class="Apple-style-span" style="font-size: medium;">u</span><span class="Apple-style-span" style="font-size: medium;">t</span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-size: medium;">t</span><span class="Apple-style-span" style="font-size: medium;">h</span><span class="Apple-style-span" style="font-size: medium;">i</span><span class="Apple-style-span" style="font-size: medium;">s</span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-size: medium;">i</span><span class="Apple-style-span" style="font-size: medium;">s</span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-size: medium;">t</span><span class="Apple-style-span" style="font-size: medium;">h</span><span class="Apple-style-span" style="font-size: medium;">e</span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-size: medium;">e</span><span class="Apple-style-span" style="font-size: medium;">x</span><span class="Apple-style-span" style="font-size: medium;">a</span><span class="Apple-style-span" style="font-size: medium;">m</span><span class="Apple-style-span" style="font-size: medium;">p</span><span class="Apple-style-span" style="font-size: medium;">l</span><span class="Apple-style-span" style="font-size: medium;">e</span><span class="Apple-style-span" style="font-size: medium;"> in the official docs </span><span class="Apple-style-span" style="font-size: medium;">s</span><span class="Apple-style-span" style="font-size: medium;">o</span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-size: medium;">I</span><span class="Apple-style-span" style="font-size: medium;">'</span><span class="Apple-style-span" style="font-size: medium;">m</span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-size: medium;">s</span><span class="Apple-style-span" style="font-size: medium;">u</span><span class="Apple-style-span" style="font-size: medium;">r</span><span class="Apple-style-span" style="font-size: medium;">p</span><span class="Apple-style-span" style="font-size: medium;">r</span><span class="Apple-style-span" style="font-size: medium;">i</span><span class="Apple-style-span" style="font-size: medium;">s</span><span class="Apple-style-span" style="font-size: medium;">e</span><span class="Apple-style-span" style="font-size: medium;">d</span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-size: medium;">i</span><span class="Apple-style-span" style="font-size: medium;">t</span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-size: medium;">d</span><span class="Apple-style-span" style="font-size: medium;">o</span><span class="Apple-style-span" style="font-size: medium;">e</span><span class="Apple-style-span" style="font-size: medium;">s</span><span class="Apple-style-span" style="font-size: medium;">n</span><span class="Apple-style-span" style="font-size: medium;">'</span><span class="Apple-style-span" style="font-size: medium;">t</span><span class="Apple-style-span" style="font-size: medium;"> </span><span class="Apple-style-span" style="font-size: medium;">w</span><span class="Apple-style-span" style="font-size: medium;">o</span><span class="Apple-style-span" style="font-size: medium;">r</span><span class="Apple-style-span" style="font-size: medium;">k</span><span class="Apple-style-span" style="font-size: medium;">.</span><span class="Apple-style-span" style="font-size: medium;">.</span><span class="Apple-style-span" style="font-size: medium;">.</span><span class="Apple-style-span" style="font-size: medium;">.</span></div><div><span class="Apple-style-span" style="font-size: medium;"><br></span></div><div><span class="Apple-style-span" style="font-size: medium;">C</span><span class="Apple-style-span" style="font-size: medium;">h</span><span class="Apple-style-span" style="font-size: medium;">e</span><span class="Apple-style-span" style="font-size: medium;">e</span><span class="Apple-style-span" style="font-size: medium;">r</span><span class="Apple-style-span" style="font-size: medium;">s</span><span class="Apple-style-span" style="font-size: medium;">,</span></div><div><span class="Apple-style-span" style="font-size: medium;"><br></span></div><div><span class="Apple-style-span" style="font-size: medium;">J</span><span class="Apple-style-span" style="font-size: medium;">u</span><span class="Apple-style-span" style="font-size: medium;">s</span><span class="Apple-style-span" style="font-size: medium;">t</span><span class="Apple-style-span" style="font-size: medium;">i</span><span class="Apple-style-span" style="font-size: medium;">n</span></div><div>-------------------------------------------------</div><div>Justin Hayes</div><div>Orbis Support Manager</div><div><a href="mailto:justin.hayes@orbisuk.com">justin.hayes@orbisuk.com</a></div><div><br></div></div></span><br class="Apple-interchange-newline"><br class="Apple-interchange-newline"> </div><br></div>_______________________________________________<br><a href="http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users">http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users</a><br><br>Community help: http://wiki.bestpractical.com<br>Commercial support: sales@bestpractical.com<br><br><br>Discover RT's hidden secrets with RT Essentials from O'Reilly Media. <br>Buy a copy at http://rtbook.bestpractical.com</blockquote></div><br></div></body></html>