Closed p5pRT closed 10 years ago
In Pod::HTML 1.04\, =begin html/=end html eats lines that consist of single newlines\, i.e. "\n". This happens because the sub clean_data is applied to the body of text before parsing. This converts the text into 'paragraphs'\, text delimited by blank lines\, which discards the delimiter. As an example\, the fragment:
=begin html
\
\
#include <stdio.h>
int main(int argc\,char *argv[]) {
printf("Hellow World\n"); return 0;
} \ \
=end html
should display as:
#include \<stdio.h>
int main(int argc\,char *argv[]) {
printf("Hellow World\n"); return 0;
}
not as:
#include \<stdio.h>int main(int argc\,char *argv[]) { printf("Hellow World\n"); return 0;}
There is an obvious work-around of 'no blank lines--use '
--hsm
Attached is a small patch for Pod::Html (against Pod::Html 1.09_04).
-- Renée BÀcker renee.baecker@smart-websolutions.de
XING: http://www.xing.com/profile/Renee_Baecker Foo-Magazin: http://foo-magazin.de
.*?(?)/ ){ + $is_pre = 1; + } + + my $nl = $is_pre ? "\n\n" : "\n"; + print HTML ($_,$nl) and next if @Begin_Stack && $Begin_Stack[-1] eq 'html'; + my $text = $_; # Open tag for definition list as we have something to put in it ```
Here it is...
Bram wrote:
Citeren RenĂ©e BĂ€cker \renee\.baecker@​smart\-websolutions\.de:
Attached is a small patch for Pod::Html (against Pod::Html 1.09_04).
Can you also add a test for it?
Kind regards\,
Bram
-- Renée BÀcker renee.baecker@smart-websolutions.de
XING: http://www.xing.com/profile/Renee_Baecker Foo-Magazin: http://foo-magazin.de
use strict; use warnings; use lib qw(/home/rbaecker/cpan/lib/perl5/5.8.8/); use Pod::Html; use Config; use Test::More tests => 1;
my $out = $$ . '.html'; pod2html("--infile=$0"\, "--outfile=$out");
my $admin = $Config{'perladmin'};
my $expected = \<\<"EXPECTED"; \<?xml version="1.0" ?> \<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> \ \
\\
\<!-- INDEX BEGIN --> \
\<!-- INDEX END -->\
\
\9385.pl - A testscript for bug #9385\
\\
\The following testcase shows the bug\
\in Pod::Html\
\ \#include <stdio.h>\ this is a test line in an HTML section of this Pod.int main(int argc\,char *argv[]) {
printf("Hellow World\\n"); return 0; } \
\
\ EXPECTED
my $check;
{ local $/; open my $fh\, '\<'\, $out or die "Cannot open $out: $!"; $check = \<$fh>; close $fh; }
$check =~ s/\r?\n/\n/g; $expected =~ s/\r?\n/\n/g;
is( $check\, $expected );
1 while unlink $out; 1 while unlink "pod2htmd.tmp"; 1 while unlink "pod2htmi.tmp";
=head1 NAME
9385.pl - A testscript for bug #9385
=head2 TESTCASE
The following testcase shows the bug
in Pod::Html
=begin html
\
\
#include <stdio.h>
int main(int argc\,char *argv[]) {
printf("Hellow World\n"); return 0; } \ \
this is a test line in
an HTML section of this Pod.
=end html
Renée BÀcker a écrit :
Attached is a small patch for Pod::Html (against Pod::Html 1.09_04).
I've just discovered this message\, as I summarise a fortnight's worth of traffic (I needed a break).
Anyway\, 1.09_04 is on CPAN\, but not in blead\, since the first step of detabbing the source and pushing the POD to the end of the source file (which is what I would need to do in order to stay sane) was greeted with shrieks of horror that someone would dare reformat TomC's hallowed code.
So\, at the moment\, development is stalled until I hear otherwise.
David
I am attaching what I believe is a very slightly cleaned-up version of the test file supplied by Renee_Baecker four years ago. The bug appears to persist when tested with Perl 5.14.2.
use strict; use warnings; use Pod::Html; use Config; use Test::More tests => 1;
my $out = $$ . '.html'; pod2html("--infile=$0"\, "--outfile=$out");
my $admin = $Config{'perladmin'};
my $expected = \<\<"EXPECTED"; \<?xml version="1.0" ?> \<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> \ \
\\
\<!-- INDEX BEGIN --> \
\<!-- INDEX END -->\
\
\9385.pl - A testscript for bug #9385\
\\
\The following testcase shows the bug\
\in Pod::Html\
\ \#include <stdio.h>\ this is a test line in an HTML section of this Pod.int main(int argc\,char *argv[]) {
printf("Hellow World\\n"); return 0; } \
\
\ EXPECTED
my $check;
{ local $/; open my $fh\, '\<'\, $out or die "Cannot open $out: $!"; $check = \<$fh>; close $fh; }
$check =~ s/\r?\n/\n/g; $expected =~ s/\r?\n/\n/g;
is( $check\, $expected );
1 while unlink $out; 1 while unlink "pod2htmd.tmp"; 1 while unlink "pod2htmi.tmp";
=head1 NAME
9385.pl - A testscript for bug #9385
=head2 TESTCASE
The following testcase shows the bug
in Pod::Html
=begin html
\
\
#include <stdio.h>
int main(int argc\,char *argv[]) {
printf("Hellow World\n"); return 0; } \ \
this is a test line in
an HTML section of this Pod.
=end html
On Mon Mar 26 18:10:25 2012\, jkeenan wrote:
I am attaching what I believe is a very slightly cleaned-up version of the test file supplied by Renee_Baecker four years ago. The bug appears to persist when tested with Perl 5.14.2.
The original bug report -- back in 2002! -- summarized the problem like this:
##### In Pod::HTML 1.04\, =begin html/=end html eats lines that consist of single newlines\, i.e. "\n". This happens because the sub clean_data is applied to the body of text before parsing. This converts the text into 'paragraphs'\, text delimited by blank lines\, which discards the delimiter. #####
There no longer appears to be a subroutine called clean_data() in Pod::Html. But\, as the test file attached in my previous post demonstrates\, the bug is still there.
Thank you very much. Jim Keenan
It looks like this ticket should probably be moved over to Pod::Simple. I think this issue may be somewhere in Pod::Simple::BlackBox\, but the comments started to get a little too Lovecraftian for me.
On Mon Mar 26 18:28:49 2012\, jkeenan wrote:
On Mon Mar 26 18:10:25 2012\, jkeenan wrote:
I am attaching what I believe is a very slightly cleaned-up version of the test file supplied by Renee_Baecker four years ago. The bug appears to persist when tested with Perl 5.14.2.
The original bug report -- back in 2002! -- summarized the problem like this:
##### In Pod::HTML 1.04\, =begin html/=end html eats lines that consist of single newlines\, i.e. "\n". This happens because the sub clean_data is applied to the body of text before parsing. This converts the text into 'paragraphs'\, text delimited by blank lines\, which discards the delimiter. #####
There no longer appears to be a subroutine called clean_data() in Pod::Html. But\, as the test file attached in my previous post demonstrates\, the bug is still there.
Thank you very much. Jim Keenan
On Sat Nov 17 15:58:57 2012\, mfollett wrote:
It looks like this ticket should probably be moved over to Pod::Simple. I think this issue may be somewhere in Pod::Simple::BlackBox\, but the comments started to get a little too Lovecraftian for me.
I agree. I have filed a ticket in Pod-Simple's own bug tracker at: https://rt.cpan.org/Ticket/Display.html?id=91851
Closing this ticket.
Thank you very much. Jim Keenan
@jkeenan - Status changed from 'open' to 'rejected'
I believe this issue is fixed as of http://github.com/theory/pod-simple/commits/bb23b85. Additional testing would be much appreciated!
Migrated from rt.perl.org#9385 (status was 'rejected')
Searchable as RT9385$