File Coverage

blib/lib/Text/MustacheTemplate/HTML.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 22 22 100.0


line stmt bran cond sub pod time code
1             package Text::MustacheTemplate::HTML;
2 13     13   216 use 5.022000;
  13         44  
3 13     13   72 use strict;
  13         22  
  13         364  
4 13     13   52 use warnings;
  13         22  
  13         694  
5              
6 13     13   63 use Exporter 5.57 'import';
  13         196  
  13         840  
7              
8             our @EXPORT_OK = qw/escape_html/;
9              
10 13     13   6616 use HTML::Escape ();
  13         12334  
  13         1255  
11              
12             our $ESCAPE = \&HTML::Escape::escape_html;
13              
14 359     359 1 2047 sub escape_html { goto $ESCAPE }
15              
16             1;
17              
18             =encoding utf-8
19              
20             =head1 NAME
21              
22             Text::MustacheTemplate::HTML - HTML escape for Text::MustacheTemplate
23              
24             =head1 SYNOPSIS
25              
26             use Text::MustacheTemplate;
27             use Text::MustacheTemplate::HTML;
28              
29             # custom html escape
30             local $Text::MustacheTemplate::HTML::ESCAPE = sub { ... };
31              
32             my @tokens = Text::MustacheTemplate->parse('* {{variable}}');
33              
34             =head1 DESCRIPTION
35              
36             Text::MustacheTemplate::HTML is a HTML escape for Mustache template.
37              
38             This is low-level interface for Text::MustacheTemplate.
39             The APIs may be change without notice.
40              
41             =head1 EXPORTS
42              
43             =over 2
44              
45             =item escape_html
46              
47             By default, it is the C function of L itself.
48             When C<$Text::MustacheTemplate::HTML::ESCAPE> is overwritten, call that instead of L.
49              
50             =back
51              
52             =head1 LICENSE
53              
54             Copyright (C) karupanerura.
55              
56             This library is free software; you can redistribute it and/or modify
57             it under the same terms as Perl itself.
58              
59             =head1 AUTHOR
60              
61             karupanerura Ekarupa@cpan.orgE
62              
63             =cut
64