File Coverage

blib/lib/KinoSearch1/Highlight/SimpleHTMLEncoder.pm
Criterion Covered Total %
statement 20 20 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 26 27 96.3


line stmt bran cond sub pod time code
1             package KinoSearch1::Highlight::SimpleHTMLEncoder;
2 18     18   101 use strict;
  18         40  
  18         598  
3 18     18   100 use warnings;
  18         41  
  18         423  
4 18     18   105 use KinoSearch1::Util::ToolSet;
  18         37  
  18         2980  
5 18     18   115 use base qw( KinoSearch1::Util::Class );
  18         59  
  18         1743  
6              
7             BEGIN {
8 18     18   169 __PACKAGE__->init_instance_vars();
9             }
10              
11             sub encode {
12 14     14 0 69 my $text = $_[1];
13 14         19 for ($text) {
14 14         20 s/&/&/g;
15 14         20 s/"/"/g;
16 14         15 s/
17 14         25 s/>/>/g;
18             }
19 14         44 return $text;
20             }
21              
22             1;
23              
24             __END__