Skip to content

Commit 2e700a5

Browse files
committed
Pod::Simple::XHTML: better fallback when HTML::Entities isn't installed
This commit changes the default set of escaped characters in the fallback code to be the same as in HTML::Entities. Fixes #188
1 parent 0019223 commit 2e700a5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Pod/Simple/XHTML.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)