Fix dbdToHtml.pl for old versions of Pod::Simple::XHTML
This commit is contained in:
+10
-3
@@ -126,6 +126,8 @@ open my $out, '>', $opt_o or
|
||||
|
||||
my $podHtml;
|
||||
my $idify;
|
||||
my $contentType =
|
||||
'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >';
|
||||
|
||||
if ($::XHTML) {
|
||||
$podHtml = Pod::Simple::XHTML->new();
|
||||
@@ -134,7 +136,13 @@ if ($::XHTML) {
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
|
||||
__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<link rel='stylesheet' href='style.css' type='text/css'>");
|
||||
|
||||
@@ -143,8 +151,7 @@ __END_DOCTYPE
|
||||
return $podHtml->idify($title, 1);
|
||||
}
|
||||
} else { # Fall back to HTML
|
||||
$Pod::Simple::HTML::Content_decl =
|
||||
q{<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >};
|
||||
$Pod::Simple::HTML::Content_decl = $contentType;
|
||||
$podHtml = Pod::Simple::HTML->new();
|
||||
$podHtml->html_css('style.css');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user