| 1 | package HTML::Escape::PurePerl; | ||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | die qq{Don't use HTML::Escape::PurePerl directly, use HTML::Escape instead.\n} # ' for poor editors | ||||||||
|
Branch: 1 branch
| |||||||||||
| 7 | if caller() ne 'HTML::Escape'; | ||||||||||
| 8 | |||||||||||
| 9 | package # do not index, pause. | ||||||||||
| 10 | HTML::Escape; | ||||||||||
| 11 | |||||||||||
| 12 | 1 | our %_escape_table = ( '&' => '&', '>' => '>', '<' => '<', q{"} => '"', q{'} => ''', q{`} => '`', '{' => '{', '}' => '}' ); | |||||||||
| 13 | sub escape_html { | ||||||||||
| 14 | 5 | ▶ | my $str = shift; | ||||||||
|
Subroutine
escape_html: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 15 | 5 | ▶ | return '' | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | unless defined $str; | ||||||||||
| 17 | 5 | $str =~ s/([&><"'`{}])/$_escape_table{$1}/ge; #' for poor editors | |||||||||
| 18 | 5 | return $str; | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 1 | 1; | |||||||||
| 22 | |||||||||||