From 10e9db371070248285b831d702374cccdde3571c Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 21 Oct 2019 17:54:06 -0500 Subject: [PATCH] Fix dbdToHtml.pl for old versions of Pod::Simple::XHTML --- src/tools/dbdToHtml.pl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/tools/dbdToHtml.pl b/src/tools/dbdToHtml.pl index adf2f004a..7a80dec4c 100644 --- a/src/tools/dbdToHtml.pl +++ b/src/tools/dbdToHtml.pl @@ -126,6 +126,8 @@ open my $out, '>', $opt_o or my $podHtml; my $idify; +my $contentType = + ''; if ($::XHTML) { $podHtml = Pod::Simple::XHTML->new(); @@ -134,7 +136,13 @@ if ($::XHTML) { __END_DOCTYPE - $podHtml->html_charset('UTF-8'); + if ($podHtml->can('html_charset')) { + $podHtml->html_charset('UTF-8'); + } + else { + # Older version of Pod::Simple::XHTML without html_charset() + $podHtml->html_header_tags($contentType); + } $podHtml->html_header_tags($podHtml->html_header_tags . "\n"); @@ -143,8 +151,7 @@ __END_DOCTYPE return $podHtml->idify($title, 1); } } else { # Fall back to HTML - $Pod::Simple::HTML::Content_decl = - q{}; + $Pod::Simple::HTML::Content_decl = $contentType; $podHtml = Pod::Simple::HTML->new(); $podHtml->html_css('style.css');