| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Text::Markup::Pod; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 2 |  |  | 2 |  | 39730 | use 5.8.1; | 
|  | 2 |  |  |  |  | 7 |  | 
| 4 | 2 |  |  | 2 |  | 16 | use strict; | 
|  | 2 |  |  |  |  | 5 |  | 
|  | 2 |  |  |  |  | 66 |  | 
| 5 | 2 |  |  | 2 |  | 11 | use warnings; | 
|  | 2 |  |  |  |  | 5 |  | 
|  | 2 |  |  |  |  | 100 |  | 
| 6 | 2 |  |  | 2 |  | 741 | use Pod::Simple::XHTML 3.15; | 
|  | 2 |  |  |  |  | 37368 |  | 
|  | 2 |  |  |  |  | 527 |  | 
| 7 |  |  |  |  |  |  |  | 
| 8 |  |  |  |  |  |  | # Disable the use of HTML::Entities. | 
| 9 |  |  |  |  |  |  | $Pod::Simple::XHTML::HAS_HTML_ENTITIES = 0; | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  | our $VERSION = '0.25'; | 
| 12 |  |  |  |  |  |  |  | 
| 13 |  |  |  |  |  |  | sub parser { | 
| 14 | 4 |  |  | 4 | 0 | 14 | my ($file, $encoding, $opts) = @_; | 
| 15 | 4 |  |  |  |  | 24 | my $p = Pod::Simple::XHTML->new; | 
| 16 |  |  |  |  |  |  | # Output everything as UTF-8. | 
| 17 | 4 |  |  |  |  | 417 | $p->html_header_tags(''); | 
| 18 | 4 |  |  | 3 |  | 41 | $p->strip_verbatim_indent(sub { (sort map { /^(\s+)/ } @{$_[0]})[0] }); | 
|  | 3 |  |  |  |  | 13139 |  | 
|  | 15 |  |  |  |  | 51 |  | 
|  | 3 |  |  |  |  | 9 |  | 
| 19 | 4 |  |  |  |  | 40 | $p->output_string(\my $html); | 
| 20 |  |  |  |  |  |  | # Want user supplied options to override even these default behaviors, | 
| 21 |  |  |  |  |  |  | # if necessary | 
| 22 | 4 | 100 |  |  |  | 2364 | my $opt = $opts ? { @$opts } : {}; | 
| 23 | 4 |  |  |  |  | 14 | foreach my $method ( keys %$opt ) { | 
| 24 | 3 |  |  |  |  | 9 | my $v = $opt->{$method}; | 
| 25 | 3 |  |  |  |  | 9 | $p->$method($v); | 
| 26 |  |  |  |  |  |  | } | 
| 27 | 4 |  |  |  |  | 37 | $p->parse_file($file); | 
| 28 | 4 | 100 |  |  |  | 1930 | return unless $p->content_seen; | 
| 29 | 3 |  |  |  |  | 31 | utf8::encode($html); | 
| 30 | 3 |  |  |  |  | 103 | return $html; | 
| 31 |  |  |  |  |  |  | } | 
| 32 |  |  |  |  |  |  |  | 
| 33 |  |  |  |  |  |  | 1; | 
| 34 |  |  |  |  |  |  | __END__ |