71 |
default => 250, |
default => 250, |
72 |
); |
); |
73 |
|
|
74 |
|
has 'wrap_in_page' => ( |
75 |
|
documentation => 'wrap full html page with status bar around content', |
76 |
|
is => 'rw', |
77 |
|
isa => 'Bool', |
78 |
|
default => 1, |
79 |
|
); |
80 |
|
|
81 |
my %escape = ('<'=>'<', '>'=>'>', '&'=>'&', '"'=>'"'); |
my %escape = ('<'=>'<', '>'=>'>', '&'=>'&', '"'=>'"'); |
82 |
my $escape_re = join '|' => keys %escape; |
my $escape_re = join '|' => keys %escape; |
83 |
|
|
208 |
$content |
$content |
209 |
<!-- $type via $package at $path line $line --> |
<!-- $type via $package at $path line $line --> |
210 |
|; |
|; |
211 |
} elsif ( $content =~ m{^(/|https?://)} ) { |
} elsif ( $content =~ m{^(/\w+|https?://)} && $content !~ m{[\n\r]} ) { |
212 |
if ( $what eq 'js' ) { |
if ( $what eq 'js' ) { |
213 |
$head = qq| |
$head = qq| |
214 |
<$tag type="$type" src="$content"> |
<$tag type="$type" src="$content"> |
283 |
warn "# no body, invoke $self->$run on ", ref($self); |
warn "# no body, invoke $self->$run on ", ref($self); |
284 |
$body = $self->$run; |
$body = $self->$run; |
285 |
} |
} |
286 |
if ( $self->content_type !~ m{html} ) { |
if ( $self->content_type !~ m{html} || ! $self->wrap_in_page ) { |
287 |
warn "# return only $self body ", $self->content_type; |
warn "# return only $self body ", $self->content_type; |
288 |
return $body |
return $body |
289 |
} elsif ( ! defined $body ) { |
} elsif ( ! defined $body ) { |