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 {
70
70
$ents =~ s ,(?<!\\)([]/]),\\$1 ,g;
71
71
$ents =~ s ,(?<!\\)\\\z,\\\\,;
72
72
} else {
73
- $ents = join ' ' , keys %entities ;
73
+ # the same set of characters as in HTML::Entities
74
+ $ents = ' ^\n\r\t !\#\$%\(-;=?-~' ;
74
75
}
75
76
my $str = $_ [0];
76
77
$str =~ s / ([$ents])/ '&' . ($entities {$1 } || sprintf '#x%X ', ord $1 ) . ';'/ ge ;
Original file line number Diff line number Diff line change 1
1
# t/xhtml01.t - check basic output from Pod::Simple::XHTML
2
2
use strict;
3
3
use warnings;
4
- use Test::More tests => 66 ;
4
+ use Test::More tests => 68 ;
5
5
6
6
use_ok(' Pod::Simple::XHTML' ) or exit ;
7
7
@@ -751,11 +751,28 @@ EOHTML
751
751
# Keep =encoding out of content.
752
752
initialize($parser , $results );
753
753
$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' );
755
755
<h1 id="NAME">NAME</h1>
756
756
757
757
EOHTML
758
758
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
759
776
}
760
777
761
778
You can’t perform that action at this time.
0 commit comments