);
@ISA = ('Pod::Simple::BlackBox');
-$VERSION = '3.06';
+$VERSION = '3.07';
@Known_formatting_codes = qw(I B C L E F S X Z);
%Known_formatting_codes = map(($_=>1), @Known_formatting_codes);
package Pod::Simple::XHTML;
use strict;
-use vars qw( $VERSION @ISA );
+use vars qw( $VERSION @ISA $HAS_HTML_ENTITIES );
$VERSION = '3.04';
use Carp ();
use Pod::Simple::Methody ();
@ISA = ('Pod::Simple::Methody');
-use HTML::Entities 'encode_entities';
+BEGIN {
+ $HAS_HTML_ENTITIES = eval "require HTML::Entities; 1";
+}
+
+my %entities = (
+ q{>} => 'gt',
+ q{<} => 'lt',
+ q{'} => '#39',
+ q{"} => 'quot',
+ q{&} => 'amp',
+);
+
+sub encode_entities {
+ return HTML::Entities::encode_entities( $_[0] ) if $HAS_HTML_ENTITIES;
+ my $str = $_[0];
+ my $ents = join '', keys %entities;
+ $str =~ s/([$ents])/'&' . $entities{$1} . ';'/ge;
+ return $str;
+}
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
use strict;
use lib '../lib';
-use Test::More tests => 25;
+use Test::More tests => 26;
use_ok('Pod::Simple::XHTML') or exit;
EOHTML
-initialize($parser, $results);
-$parser->parse_string_document(<<'EOPOD');
+SKIP: for my $use_html_entities (0, 1) {
+ if ($use_html_entities and not $Pod::Simple::XHTML::HAS_HTML_ENTITIES) {
+ skip("HTML::Entities not installed", 1);
+ }
+ local $Pod::Simple::XHTML::HAS_HTML_ENTITIES = $use_html_entities;
+ initialize($parser, $results);
+ $parser->parse_string_document(<<'EOPOD');
=pod
# this header is very important & don't you forget it
my \$text = "File is: " . <FILE>;</code></pre>
EOHTML
+}
######################################