| 1 | package HTML::Zoom::Producer::BuiltIn; | ||||||||||||||||||||||
| 2 | |||||||||||||||||||||||
| 3 | 13 | ▶ | use strictures 1; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 4 | 13 | ▶ | use base qw(HTML::Zoom::SubObject); | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 5 | |||||||||||||||||||||||
| 6 | 84 | ▶ | sub html_from_stream { | ||||||||||||||||||||
|
Subroutine
html_from_stream: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||
| 7 | 84 | my ($self, $stream) = @_; | |||||||||||||||||||||
| 8 | return | ||||||||||||||||||||||
| 9 | 84 | join '', | |||||||||||||||||||||
| 10 | map $self->event_to_html($_), | ||||||||||||||||||||||
| 11 | $self->_zconfig->stream_utils->stream_to_array($stream) | ||||||||||||||||||||||
| 12 | } | ||||||||||||||||||||||
| 13 | |||||||||||||||||||||||
| 14 | 2 | ▶ | sub html_from_events { | ||||||||||||||||||||
|
Subroutine
html_from_events: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||
| 15 | 2 | my ($self, $events) = @_; | |||||||||||||||||||||
| 16 | 2 | join '', map $self->event_to_html($_), @$events; | |||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||
| 18 | |||||||||||||||||||||||
| 19 | 1242 | ▶ | sub event_to_html { | ||||||||||||||||||||
|
Subroutine
event_to_html: called CC=8 SCAR=20.9
Pod
undocumented
| |||||||||||||||||||||||
| 20 | 1242 | my ($self, $evt) = @_; | |||||||||||||||||||||
| 21 | # big expression | ||||||||||||||||||||||
| 22 | 1242 | ▶ | if (defined $evt->{raw}) { | ||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||
| 23 | $evt->{raw} | ||||||||||||||||||||||
| 24 | 1199 | } elsif ($evt->{type} eq 'OPEN') { | |||||||||||||||||||||
| 25 | '<' | ||||||||||||||||||||||
| 26 | .$evt->{name} | ||||||||||||||||||||||
| 27 | .(defined $evt->{raw_attrs} | ||||||||||||||||||||||
| 28 | ? $evt->{raw_attrs} | ||||||||||||||||||||||
| 29 | : do { | ||||||||||||||||||||||
| 30 | 36 | my @names = @{$evt->{attr_names}}; | |||||||||||||||||||||
| 31 | @names | ||||||||||||||||||||||
| 32 | 36 | ▶ | ? join(' ', '', map qq{${_}="${\$evt->{attrs}{$_}}"}, @names) | ||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||
| 33 | : '' | ||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||
| 35 | ) | ||||||||||||||||||||||
| 36 | 38 | ▶ | .($evt->{is_in_place_close} ? ' /' : '') | ||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||
| 37 | .'>' | ||||||||||||||||||||||
| 38 | } elsif ($evt->{type} eq 'CLOSE') { | ||||||||||||||||||||||
| 39 | 4 | '</'.$evt->{name}.'>' | |||||||||||||||||||||
| 40 | } elsif ($evt->{type} eq 'EMPTY') { | ||||||||||||||||||||||
| 41 | 1 | '' | |||||||||||||||||||||
| 42 | } else { | ||||||||||||||||||||||
| 43 | 0 | die "No raw value in event and no special handling for type ".$evt->{type}; | |||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||
| 46 | |||||||||||||||||||||||
| 47 | 13 | 1; | |||||||||||||||||||||