File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,8 @@ sub encode_entities {
7070 $ents =~ s ,(?<!\\)([]/]),\\$1 ,g;
7171 $ents =~ s ,(?<!\\)\\\z,\\\\,;
7272 } else {
73- $ents = join ' ' , keys %entities ;
73+ # the same set of characters as in HTML::Entities
74+ $ents = ' ^\n\r\t !\#\$%\(-;=?-~' ;
7475 }
7576 my $str = $_ [0];
7677 $str =~ s / ([$ents])/ '&' . ($entities {$1 } || sprintf '#x%X ', ord $1 ) . ';'/ ge ;
Original file line number Diff line number Diff line change 11# t/xhtml01.t - check basic output from Pod::Simple::XHTML
22use strict;
33use warnings;
4- use Test::More tests => 66 ;
4+ use Test::More tests => 68 ;
55
66use_ok(' Pod::Simple::XHTML' ) or exit ;
77
@@ -751,11 +751,28 @@ EOHTML
751751 # Keep =encoding out of content.
752752 initialize($parser , $results );
753753 $parser -> parse_string_document(" =encoding ascii\n\n =head1 NAME\n " );
754- is($results , <<"EOHTML" , ' Encoding should not be in content' )
754+ is($results , <<"EOHTML" , ' Encoding should not be in content' );
755755<h1 id="NAME">NAME</h1>
756756
757757EOHTML
758758
759+ initialize($parser , $results );
760+ $parser -> parse_string_document(<<"EOPOD" );
761+ =pod
762+
763+ =encoding UTF-8
764+
765+ Encyclopædia Britannica
766+
767+ =cut
768+
769+ EOPOD
770+
771+ $T = $use_html_entities ? ' æ' : sprintf (' &#x%X;' , ord (" \x{E6} " ));
772+ is($results , <<"EOHTML" , ' Non-ASCII characters are escaped' )
773+ <p>Encyclop${T} dia Britannica</p>
774+
775+ EOHTML
759776}
760777
761778
You can’t perform that action at this time.
0 commit comments