Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6b5c8a3460
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (16 sloc) 0.458 kb
package PerlOrg::Template::Filters;
use strict;
sub navigation_filter_factory {
my ($context, $uri) = @_;
return sub {
my $text = shift;
return $text unless $uri;
$uri =~ s!/?index(?:\.html)?$!/!;
# why is this here? -- need to write some tests for this... made
# it work by adding a /? below.
$uri =~ s!/$!!;
$text =~ s{(<li>)\s*(<a href="\Q$uri\E/?">(.+?)</a>)}{<li class="selected">$2}i;
return $text;
Jump to Line
Something went wrong with that request. Please try again.