Skip Menu |

This queue is for tickets about the Pod-HtmlEasy CPAN distribution.

Report information
The Basics
Id: 31784
Status: resolved
Worked: 20 min
Priority: 0/
Queue: Pod-HtmlEasy

People
Owner: GLEACH [...] cpan.org
Requestors: banb [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.09
  • 0.091
Fixed in: 0.0912



Subject: only_content option doesn't work
At least prior to release 0.07, pod2html() option 'only_content' works fine. In current release, this option does not work properly. It only removes the first <body> tag.
On Thu Dec 20 22:20:31 2007, BANB wrote: Show quoted text
> At least prior to release 0.07, pod2html() option 'only_content' works
fine. Show quoted text
> > In current release, this option does not work properly. > It only removes the first <body> tag.
Yow! A user! And here I thought that nobody cared :-) The (current) definition of only_content is: If set only generate the HTML content (between <body>...</body>). so I don't understand what this problem is. Perhaps a (small) example of what is not working would be possible?
GLEACH wrote: Show quoted text
> The (current) definition of only_content is: > If set only generate the HTML content (between <body>...</body>). > so I don't understand what this problem is. Perhaps a (small) example of > what is not working would be possible?
OK. Let me figure it out. [Simplified output in normal condition] <html> <head><title>foo bar</title></head> <body bgcolor="white"> blah blah blah ... </body></html> [Output of older versions (just work fine)] blah blah blah ... [Current version (invalid output)] <html> <head><title>foo bar</title></head> blah blah blah ... </body></html> Show quoted text
> Yow! A user! And here I thought that nobody cared :-)
I love this module because of two advantages over other modules. One is that it can process POD in on-memory interface without temporary file. The other reason is ability for output customization. At least one person (not me) cares about and admires this fancy module ;-) http://cpanratings.perl.org/dist/Pod-HtmlEasy Regards.
On Mon Dec 24 19:43:31 2007, BANB wrote: Show quoted text
> GLEACH wrote:
> > The (current) definition of only_content is: > > If set only generate the HTML content (between <body>...</body>). > > so I don't understand what this problem is. Perhaps a (small) example of > > what is not working would be possible?
> > OK. Let me figure it out. > > [Simplified output in normal condition] > <html> > <head><title>foo bar</title></head> > <body bgcolor="white"> > blah blah blah ... > </body></html> > > [Output of older versions (just work fine)] > blah blah blah ... > > [Current version (invalid output)] > <html> > <head><title>foo bar</title></head> > blah blah blah ... > </body></html>
Fixed. FWIW, I'm curious as to the context of the problem. Firefox for example does not care about the mismatchd close tag.
On 水曜日 12月 26 12:30:31 2007, GLEACH wrote: Show quoted text
> Fixed. FWIW, I'm curious as to the context of the problem. Firefox for > example does not care about the mismatchd close tag.
Thank you for quick response. But unfortunately the bug still exists. Sorry for lack of information on the first bug report. The most important point of the problem is that an output with "only_content" option still contains '<!DOCTYPE>', '<html>', '<head>' tags, and so on. (Or am I misunderstand specification?) I've attached the patch against 0.0911. This patch is just a quick hack, so simply appling it breaks indendations of the code. Just for reference. Regards.
--- Pod-HtmlEasy-0.0911/lib/Pod/HtmlEasy.pm 2007-12-26 05:42:36.000000000 +0900 +++ Pod-HtmlEasy-dev/lib/Pod/HtmlEasy.pm 2007-12-27 17:29:53.000000000 +0900 @@ -332,6 +332,8 @@ # Build the header to the HTML file my @html; + my $title_line_ref; + if ( not exists $args{only_content} ) { # [31784] push @html, qq{<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">$NL}; push @html, qq{<html><head>$NL}; @@ -343,11 +345,10 @@ qq{<meta name="GENERATOR" content="Pod::HtmlEasy/$VERSION Pod::Parser/$Pod::Parser::VERSION Perl/$] [$^O]">$NL}; } push @html, qq{<title>$title</title>$NL}; - my $title_line_ref = \$html[-1]; + $title_line_ref = \$html[-1]; push @html, _organize_css( \%args ); push @html, qq{</head>$NL}; - if ( not exists $args{only_content} ) { - push @html, _organize_body( \%args ); + push @html, _organize_body( \%args ); } delete $this->{UPARROW}; @@ -375,7 +376,9 @@ # If there's a head1 NAME, we've picked this up during processing if ( defined $this->{TITLE} && length $this->{TITLE} > 0 ) { - ${$title_line_ref} = qq{<title>$this->{TITLE}</title>$NL}; + if (defined $title_line_ref) { + ${$title_line_ref} = qq{<title>$this->{TITLE}</title>$NL}; + } } # Note conflict here: user can specify an index, and no_index; no_index wins @@ -386,8 +389,9 @@ push @html, qq{<div class='pod'><div>$NL}; push @html, @{$output}; # The pod converted to HTML push @html, q{</div>}; - if ( not defined $args{only_content} ){ push @html, q{</body>}; } # [31784] - push @html, qq{</html>$NL}; + if ( not exists $args{only_content} ) { # [31784] + push @html, qq{</body></html>$NL}; + } delete $this->{TIEDOUTPUT}; close $html or carp q{Could not close html};
On Thu Dec 27 03:44:12 2007, BANB wrote: Show quoted text
> On 水曜日 12月 26 12:30:31 2007, GLEACH wrote:
> > Fixed. FWIW, I'm curious as to the context of the problem. Firefox for > > example does not care about the mismatchd close tag.
> > Thank you for quick response. > But unfortunately the bug still exists. > > Sorry for lack of information on the first bug report. > The most important point of the problem is that an output with > "only_content" option still contains '<!DOCTYPE>', '<html>', '<head>' > tags, and so on. > > (Or am I misunderstand specification?) > > > I've attached the patch against 0.0911. > This patch is just a quick hack, so simply appling it breaks > indendations of the code. Just for reference. > > Regards.
Amazing how a patch can focus the mind! :-) 0.9212 has been uploaded.