blib/lib/Template/Stash/AutoEscape/Escaped/HTML.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 18 | 18 | 100.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 4 | 4 | 100.0 |
pod | 0 | 1 | 0.0 |
total | 22 | 23 | 95.6 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Template::Stash::AutoEscape::Escaped::HTML; | ||||||
2 | 2 | 2 | 1394 | use strict; | |||
2 | 3 | ||||||
2 | 78 | ||||||
3 | 2 | 2 | 10 | use warnings; | |||
2 | 4 | ||||||
2 | 50 | ||||||
4 | 2 | 2 | 10 | use base qw(Template::Stash::AutoEscape::Escaped::Base); | |||
2 | 4 | ||||||
2 | 14 | ||||||
5 | |||||||
6 | sub escape { | ||||||
7 | 10 | 10 | 0 | 17 | my $class = shift; | ||
8 | 10 | 14 | my $text = shift; | ||||
9 | 10 | 24 | for ($text) { | ||||
10 | 10 | 29 | s/&/&/g; | ||||
11 | 10 | 45 | s/</g; | ||||
12 | 10 | 36 | s/>/>/g; | ||||
13 | 10 | 22 | s/"/"/g; | ||||
14 | 10 | 27 | s/'/'/g; | ||||
15 | } | ||||||
16 | 10 | 33 | return $text; | ||||
17 | # return $class->new($text, 1); | ||||||
18 | } | ||||||
19 | |||||||
20 | 1; | ||||||
21 |