Bug#423168: pod2html produces invalid XHTML

2007-09-05 Thread Frans Pop
tag 423168 + patch
thanks

This particular issue can be resolved using one of the attached alternative 
patches. The effect of the patches is identical, it is just the 
implementation that is slightly different. Pick whichever you prefer.

Note that there are other issues with the generation of (nested) definition
lists which I will address in a separate bug report.

Cheers,
FJP

--- perl-5.8.8/lib/Html.pm.orig	2006-12-05 12:52:37.0 +0100
+++ perl-5.8.8/lib/Html.pm	2007-09-05 18:29:42.0 +0200
@@ -1120,7 +1120,7 @@
 $name = anchorify($name);
 	print HTML qq{a name=$name}, process_text( \$otext ), '/a';
 }
-print HTML /strong\n;
+print HTML /strong;
 undef( $EmittedItem );
 }
 
@@ -1168,6 +1168,7 @@
 my $tag = $1;
 $otext =~ s/\A\*\s+//;
 emit_item_tag( $otext, $tag, 1 );
+print HTML \n;
 }
 
 } elsif( $text =~ /\A\d+/ ){ # numbered list
@@ -1176,12 +1177,14 @@
 my $tag = $1;
 $otext =~ s/\A\d+\.?\s*//;
 emit_item_tag( $otext, $tag, 1 );
+print HTML \n;
 }
 
 } else {			# definition list
 $emitted = emit_li( 'dl' );
 if ($text =~ /\A(.+)\Z/s ){ # should have text
 emit_item_tag( $otext, $text, 1 );
+print HTML /dt\n;
 }
 $need_dd = 1;
 }
--- perl-5.8.8/lib/Html.pm.orig	2006-12-05 12:52:37.0 +0100
+++ perl-5.8.8/lib/Html.pm	2007-09-05 18:22:42.0 +0200
@@ -1105,8 +1105,8 @@
 #
 my $EmittedItem;
 
-sub emit_item_tag($$$){
-my( $otext, $text, $compact ) = @_;
+sub emit_item_tag(){
+my( $otext, $text, $compact, $closetag ) = @_;
 my $item = fragment_id( $text );
 
 $EmittedItem = $item;
@@ -1120,7 +1120,11 @@
 $name = anchorify($name);
 	print HTML qq{a name=$name}, process_text( \$otext ), '/a';
 }
-print HTML /strong\n;
+if ($closetag) {
+print HTML /strong/$closetag\n;
+} else {
+print HTML /strong\n;
+}
 undef( $EmittedItem );
 }
 
@@ -1167,7 +1171,7 @@
 if ($text =~ /\A\*\s+(.+)\Z/s ) { # with additional text
 my $tag = $1;
 $otext =~ s/\A\*\s+//;
-emit_item_tag( $otext, $tag, 1 );
+emit_item_tag( $otext, $tag, 1,  );
 }
 
 } elsif( $text =~ /\A\d+/ ){ # numbered list
@@ -1175,13 +1179,13 @@
 if ($text =~ /\A(?\d+\.?)\s*(.+)\Z/s ) { # with additional text
 my $tag = $1;
 $otext =~ s/\A\d+\.?\s*//;
-emit_item_tag( $otext, $tag, 1 );
+emit_item_tag( $otext, $tag, 1,  );
 }
 
 } else {			# definition list
 $emitted = emit_li( 'dl' );
 if ($text =~ /\A(.+)\Z/s ){ # should have text
-emit_item_tag( $otext, $text, 1 );
+emit_item_tag( $otext, $text, 1, $emitted );
 }
 $need_dd = 1;
 }


signature.asc
Description: This is a digitally signed message part.


Bug#423168: pod2html produces invalid XHTML

2007-09-05 Thread Frans Pop
On Wednesday 05 September 2007, Frans Pop wrote:
 This particular issue can be resolved using one of the attached
 alternative patches. The effect of the patches is identical, it is just
 the implementation that is slightly different. Pick whichever you prefer.

Please consider the patch in #440946 (merged with this report) instead of 
the patches in this report as the patch in #440946 also solves both this 
issue and other issues with (definition) list markup.

Thanks!


signature.asc
Description: This is a digitally signed message part.


Bug#423168: pod2html produces invalid XHTML

2007-05-10 Thread Jakub Wilk

Package: perl
Version: 5.8.8-7
Severity: normal

$ cat buggy.pl
__END__

=over 4

=item foo

=back

=cut

$ pod2html buggy.pl | xmllint - 21
-:19: parser error : Opening and ending tag mismatch: dt line 17 and dl
/dl
^
-:21: parser error : Opening and ending tag mismatch: dl line 16 and body
/body
  ^
-:23: parser error : Opening and ending tag mismatch: body line 10 and html
/html
  ^
-:24: parser error : Premature end of data in tag html line 3

^

-- System Information:
Debian Release: lenny/sid
 APT prefers testing
 APT policy: (900, 'testing'), (600, 'unstable'), (500, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.18-4-686 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=pl_PL (charmap=ISO-8859-2)
Shell: /bin/sh linked to /bin/dash

Versions of packages perl depends on:
ii  libc6   2.3.6.ds1-13 GNU C Library: Shared libraries
ii  libdb4.44.4.20-8 Berkeley v4.4 Database Libraries [
ii  libgdbm31.8.3-3  GNU dbm database routines (runtime
ii  perl-base   5.8.8-7  The Pathologically Eclectic Rubbis
ii  perl-modules5.8.8-7  Core Perl modules

Versions of packages perl recommends:
ii  perl-doc  5.8.8-7Perl documentation

-- no debconf information

--
Jakub Wilk


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]