| 1 |
Description: Keep raw UTF-8 in Pod-generated HTML |
| 2 |
Pod::Simple >= 3.48 escapes non-ASCII characters as numeric entities even |
| 3 |
when HTML::Entities is disabled (perl-pod/pod-simple pull request #189), |
| 4 |
while older versions emit them raw. The Pod parser promises raw UTF-8 |
| 5 |
output, so pin html_encode_chars to only the five HTML special characters |
| 6 |
(&<>"'). This keeps the output stable (and raw UTF-8) regardless of the |
| 7 |
Pod::Simple version. |
| 8 |
Bug: https://github.com/theory/text-markup/issues/31 |
| 9 |
Forwarded: https://github.com/theory/text-markup/issues/31 |
| 10 |
Bug-Debian: https://bugs.debian.org/1141361 |
| 11 |
Author: gregor herrmann <[email protected]> |
| 12 |
Last-Update: 2026-09-25 |
| 13 |
Assisted-By: DeepSeek V4 Flash 0731 |
| 14 |
|
| 15 |
--- a/lib/Text/Markup/Pod.pm |
| 16 |
+++ b/lib/Text/Markup/Pod.pm |
| 17 |
@@ -22,6 +22,11 @@ |
| 18 |
# Output everything as UTF-8. |
| 19 |
$p->html_header_tags('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'); |
| 20 |
$p->strip_verbatim_indent(sub { (sort map { /^(\s+)/ } @{$_[0]})[0] }); |
| 21 |
+ # Explicitly escape only the five HTML special characters; non-ASCII |
| 22 |
+ # characters remain raw UTF-8. Pod::Simple >= 3.48 escapes all non-ASCII |
| 23 |
+ # characters by default (perl-pod/pod-simple#188), which would change this |
| 24 |
+ # module's documented raw-UTF-8 output. |
| 25 |
+ $p->html_encode_chars(q{&<>"'}) if $p->can('html_encode_chars'); |
| 26 |
$p->output_string(\my $html); |
| 27 |
# Want user supplied options to override even these default behaviors, |
| 28 |
# if necessary |