line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Plack::Middleware::HTMLify; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
1
|
|
|
1
|
|
86015
|
$Plack::Middleware::HTMLify::VERSION = '0.1.1'; |
4
|
|
|
|
|
|
|
} |
5
|
1
|
|
|
1
|
|
10
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
6
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
7
|
1
|
|
|
1
|
|
1092
|
use parent qw( Plack::Middleware ); |
|
1
|
|
|
|
|
345
|
|
|
1
|
|
|
|
|
7
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use Plack::Util; |
10
|
|
|
|
|
|
|
use Plack::Util::Accessor |
11
|
|
|
|
|
|
|
qw( set_doctype set_head set_body_start set_body_end ); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
__PACKAGE__->{'count'} = 0; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub call { |
16
|
|
|
|
|
|
|
my ( $self, $env ) = @_; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $res = $self->app->($env); |
19
|
|
|
|
|
|
|
$self->response_cb( |
20
|
|
|
|
|
|
|
$res, |
21
|
|
|
|
|
|
|
sub { |
22
|
|
|
|
|
|
|
my $res = shift; |
23
|
|
|
|
|
|
|
my $headers = $res->[1]; |
24
|
|
|
|
|
|
|
Plack::Util::header_set( $headers, 'Content-Type', 'text/html' ); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
return sub { |
27
|
|
|
|
|
|
|
my $chunk = shift; |
28
|
|
|
|
|
|
|
if ( !defined $chunk ) { |
29
|
|
|
|
|
|
|
__PACKAGE__->{'count'} = 0; |
30
|
|
|
|
|
|
|
$chunk = qq[\n |