| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Perldoc::Emitter::HTML; | 
| 2 | 1 |  |  | 1 |  | 5 | use Perldoc::Base -Base; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 9 |  | 
| 3 | 1 |  |  | 1 |  | 808 | use Perldoc::Writer; | 
|  | 1 |  |  | 1 |  | 1 |  | 
|  | 1 |  |  | 1 |  | 29 |  | 
|  | 1 |  |  |  |  | 5 |  | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 34 |  | 
|  | 1 |  |  |  |  | 584 |  | 
|  | 1 |  |  |  |  | 3 |  | 
|  | 1 |  |  |  |  | 10 |  | 
| 4 |  |  |  |  |  |  |  | 
| 5 | 1 |  |  | 1 |  | 1849 | use HTML::Entities; | 
|  | 1 |  |  |  |  | 14873 |  | 
|  | 1 |  |  |  |  | 659 |  | 
| 6 |  |  |  |  |  |  | my $prev_text; | 
| 7 |  |  |  |  |  |  |  | 
| 8 |  |  |  |  |  |  | field 'writer'; | 
| 9 |  |  |  |  |  |  |  | 
| 10 | 1 |  |  | 1 | 0 | 58 | sub init { | 
| 11 | 1 |  |  |  |  | 10 | my $writer = Perldoc::Writer->new(@_); | 
| 12 | 1 |  |  |  |  | 2433 | $self->writer($writer); | 
| 13 | 1 |  |  |  |  | 16 | return $self; | 
| 14 |  |  |  |  |  |  | } | 
| 15 |  |  |  |  |  |  |  | 
| 16 | 9 |  |  | 9 | 0 | 62 | sub begins { | 
| 17 | 9 |  |  |  |  | 16 | my $tag = shift; | 
| 18 | 9 |  |  |  |  | 14 | $tag =~ s/ .*//; | 
| 19 | 9 | 50 |  |  |  | 34 | my $output = | 
|  |  | 50 |  |  |  |  |  | 
| 20 |  |  |  |  |  |  | $tag eq 'comment' ? "\n"; | 
| 31 |  |  |  |  |  |  | } | 
| 32 |  |  |  |  |  |  | elsif ($tag =~ /a (.*)/) { | 
| 33 | 0 | 0 |  |  |  | 0 | $output .= $1 unless defined $prev_text; | 
| 34 | 0 |  |  |  |  | 0 | $output .= '">'; | 
| 35 | 0 | 0 |  |  |  | 0 | $output .= (length($1) ? $1 : $prev_text); | 
| 36 | 0 |  |  |  |  | 0 | $output .= ''; | 
| 37 |  |  |  |  |  |  | } | 
| 38 |  |  |  |  |  |  | else { | 
| 39 | 9 |  |  |  |  | 19 | $output .= "$tag>\n" | 
| 40 |  |  |  |  |  |  | } | 
| 41 | 9 |  |  |  |  | 5128 | $self->writer->print($output); | 
| 42 |  |  |  |  |  |  | } | 
| 43 | 7 |  |  | 7 | 0 | 49 | sub text { | 
| 44 | 7 |  |  |  |  | 18 | my $output = shift; | 
| 45 | 7 |  |  |  |  | 11 | $output =~ s/\\(.)/$1/g; | 
| 46 | 7 |  |  |  |  | 83 | decode_entities($output); | 
| 47 | 7 |  |  |  |  | 23 | encode_entities($output, '<>&"'); | 
| 48 | 7 |  |  |  |  | 611 | $prev_text = $output; | 
| 49 | 7 |  |  |  |  | 14 | $output .= "\n"; | 
| 50 | 7 |  |  |  |  | 227 | $self->writer->print($output); | 
| 51 |  |  |  |  |  |  | } | 
| 52 |  |  |  |  |  |  |  | 
| 53 |  |  |  |  |  |  | =head1 NAME | 
| 54 |  |  |  |  |  |  |  | 
| 55 |  |  |  |  |  |  | Perldoc::Emitter::HTML - HTML Emitter for Perldoc | 
| 56 |  |  |  |  |  |  |  | 
| 57 |  |  |  |  |  |  | =head1 SYNOPSIS | 
| 58 |  |  |  |  |  |  |  | 
| 59 |  |  |  |  |  |  | package Perldoc::Emitter::HTML; | 
| 60 |  |  |  |  |  |  |  | 
| 61 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 62 |  |  |  |  |  |  |  | 
| 63 |  |  |  |  |  |  | This class receives Perldoc events and produces HTML. | 
| 64 |  |  |  |  |  |  |  | 
| 65 |  |  |  |  |  |  | =head1 AUTHOR | 
| 66 |  |  |  |  |  |  |  | 
| 67 |  |  |  |  |  |  | Ingy döt Net | 
| 68 |  |  |  |  |  |  |  | 
| 69 |  |  |  |  |  |  | Audrey wrote the original code for this parser. | 
| 70 |  |  |  |  |  |  |  | 
| 71 |  |  |  |  |  |  | =head1 COPYRIGHT | 
| 72 |  |  |  |  |  |  |  | 
| 73 |  |  |  |  |  |  | Copyright (c) 2006. Ingy döt Net. All rights reserved. | 
| 74 |  |  |  |  |  |  |  | 
| 75 |  |  |  |  |  |  | This program is free software; you can redistribute it and/or modify it | 
| 76 |  |  |  |  |  |  | under the same terms as Perl itself. | 
| 77 |  |  |  |  |  |  |  | 
| 78 |  |  |  |  |  |  | See L | 
| 79 |  |  |  |  |  |  |  | 
| 80 |  |  |  |  |  |  | =cut |