Subject: | html_css method outputs bad header |
Date: | Fri, 3 Oct 2014 17:58:47 -0500 |
To: | <bug-Pod-Simple [...] rt.cpan.org> |
From: | Andrew Johnson <anj [...] aps.anl.gov> |
The Pod::Simple::XHTML method html_css broke sometime between versions
3.13 and 3.20. Previously (and according to the latest documentation)
the argument to this method was the URL or relative path of a file to
use as the style-sheet. However when I use it like that with newer
versions, the generated HTML header contains the argument as verbatim
text in addition to generating the link tag to the file.
Given the following code:
#!/usr/bin/env perl
use strict;
use Pod::Simple::XHTML;
my $doc = Pod::Simple::XHTML->new();
$doc->html_css('style.css');
$doc->parse_string_document(<< '__END_POD');
=head1 Hello
World.
__END_POD
Using Pod::Simple version 3.13 (Perl 5.10.1 on RHEL 6.5) the program
generates this HTML header:
Show quoted text
> <html>
> <head>
> <title></title>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
> <link rel='stylesheet' href='style.css' type='text/css'>
> </head>
However with Pod::Simple versions 3.20 and 3.28 (Perls 5.16.0 and 5.20.0
on Mac OS X) it generates this instead:
Show quoted text> <html>
> <head>
> <title></title>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />style.css<link rel='stylesheet' href='style.css' type='text/css'>
> </head>
When viewing the broken result in a browser, the name of the stylesheet
gets rendered at the top of the HTML page above the real content.
Somewhere I read that the newer version allows the argument to contain a
full style-sheet link tag instead of just the path (this option is not
documented). This works with the newer versions of Pod::Simple, but
breaks when run on older versions of Perl that have the earlier Pod::Simple.
- Andrew Johnson