File Coverage

blib/lib/Template/Plugin/Text/Filter/URI.pm
Criterion Covered Total %
statement 10 12 83.3
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 14 16 87.5


line stmt bran cond sub pod time code
1             package Template::Plugin::Text::Filter::URI;
2              
3 2     2   87769 use warnings;
  2         4  
  2         66  
4 2     2   13 use strict;
  2         3  
  2         69  
5              
6 2     2   10 use base 'Template::Plugin';
  2         7  
  2         1744  
7 2     2   220059 use Text::Filter::URI qw( filter_uri );
  0            
  0            
8              
9             =encoding utf8
10              
11             =head1 NAME
12              
13             Template::Plugin::Text::Filter::URI - Filter a string to meet URI requirements
14              
15             =cut
16              
17             our $VERSION = '0.03';
18              
19              
20             =head1 SYNOPSIS
21              
22             [% USE Text::Filter::URI %]
23             Link
24              
25             # Output
26              
27             Link
28              
29             This filter can be useful if you have a string which should be included in an url but contains illegal characters.
30              
31             See L for more information on this process.
32              
33             =cut
34              
35             sub new {
36             my ($self, $context) = @_;
37             $context->define_filter('filter_uri', \&filter_uri, '');
38             return $self;
39             }
40              
41              
42             =head1 AUTHOR
43              
44             Moritz Onken, C<< >>
45              
46             =head1 BUGS
47              
48             Please report any bugs or feature requests to C, or through
49             the web interface at L. I will be notified, and then you'll
50             automatically be notified of progress on your bug as I make changes.
51              
52              
53             =head1 SUPPORT
54              
55             You can find documentation for this module with the perldoc command.
56              
57             perldoc Template::Plugin::Text::Filter::URI
58              
59             =head1 COPYRIGHT & LICENSE
60              
61             Copyright 2008 Moritz Onken, all rights reserved.
62              
63             This program is free software; you can redistribute it and/or modify it
64             under the same terms as Perl itself.
65              
66              
67             =cut
68              
69             1; # End of Template::Plugin::Text::Filter::URI