Author: joes
Date: Mon Mar 24 03:15:03 2014
New Revision: 1580717
URL: http://svn.apache.org/r1580717
Log:
try this
Modified:
thrift/cms-site/trunk/lib/path.pm
thrift/cms-site/trunk/lib/view.pm
Modified: thrift/cms-site/trunk/lib/path.pm
URL:
http://svn.apache.org/viewvc/thrift/cms-site/trunk/lib/path.pm?rev=1580717&r1=1580716&r2=1580717&view=diff
==============================================================================
--- thrift/cms-site/trunk/lib/path.pm (original)
+++ thrift/cms-site/trunk/lib/path.pm Mon Mar 24 03:15:03 2014
@@ -27,8 +27,8 @@ our @patterns = (
view => 'sitemap',
headers => { title => "Index" }, # "Index" is magical with the
sitemap view
}],
- [qr!/README.md(?:text)?$!, snippet => { %thrift_args,
- view => [qw/reconstruct single_narrative/],
+ [qr!^/test/!, snippet => { %thrift_args,
+ view => [qw/reconstruct trim_local_link_extensions
single_narrative/],
}],
[qr/\.md(?:text)?$/, snippet => { %thrift_args,
view => 'single_narrative',
Modified: thrift/cms-site/trunk/lib/view.pm
URL:
http://svn.apache.org/viewvc/thrift/cms-site/trunk/lib/view.pm?rev=1580717&r1=1580716&r2=1580717&view=diff
==============================================================================
--- thrift/cms-site/trunk/lib/view.pm (original)
+++ thrift/cms-site/trunk/lib/view.pm Mon Mar 24 03:15:03 2014
@@ -3,4 +3,21 @@ package view;
# see https://svn.apache.org/repos/infra/websites/cms/build/lib/ASF/View.pm
use base 'ASF::View';
+sub trim_local_link_extensions {
+ my %args = @_;
+ $args{view} = [@{$args{view}}] if ref $args{view};
+ my $view = ref $args{view} ? shift @{$args{view}} : delete $args{view};
+
+ $args{content} =~ s/
+ \[
+ ( [^\]]+ )
+ \]
+ \(
+ ( (?!:http)[^\)#]*) \.\w+ (\#[^\)#])? )
+ \)
+ /[$1]($2$3)/x;
+
+ return view->can($view)->(%args);
+}
+
1;