New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect (X)HTML generated by Pod::Html #8017
Comments
From earl@earlhood.comCreated by earl@earlhood.comPod::Html generated invalid markup for lists. For example, <ol> Causing lists to be rendered like: 1. 2. Or for unordered lists: * * Notice the annoying line break after each bullet. What follows is a patch for Pod::Html based upon the version provided SPECIAL NOTE: This patch also includes a functional enhancement to Patch: Inline Patch--- Html.pm.5.8.6 Wed Jul 13 01:28:13 2005
+++ Html.pm Wed Jul 13 01:20:05 2005
@@ -524,7 +524,7 @@
} elsif (/^=over\s*(.*)/) { # =over N
process_over();
} elsif (/^=back/) { # =back
- process_back();
+ process_back($need_dd);
} elsif (/^=for\s+(\S+)\s*(.*)/si) {# =for
process_for($1,$2);
} else {
@@ -571,11 +571,10 @@
## end of experimental
if( $after_item ){
- print HTML "$text\n";
+ #print HTML "$text\n";
$After_Lpar = 1;
- } else {
- print HTML "<p>$text</p>\n";
}
+ print HTML "<p>$text</p>\n";
}
print HTML "</dd>\n" if $need_dd;
$after_item = 0;
@@ -959,6 +958,19 @@
$Pages{$_} = "" unless defined $Pages{$_};
$Pages{$_} .= "$dir/$_.pm:";
push(@pods, "$dir/$_.pm");
+ } elsif (-T "$dir/$_") { # script(?)
+ local *F;
+ if (open(F, "$dir/$_")) {
+ my $line;
+ while (defined($line = <F>)) {
+ if ($line =~ /^=(?:pod|head1)/) {
+ $Pages{$_} = "" unless defined $Pages{$_};
+ $Pages{$_} .= "$dir/$_.pod:";
+ last;
+ }
+ }
+ close(F);
+ }
}
}
closedir(DIR);
@@ -1107,7 +1119,8 @@
$name = anchorify($name);
print HTML qq{<a name="$name">}, process_text( \$otext ), '</a>';
}
- print HTML "</strong><br />\n";
+ #print HTML "</strong><br />\n";
+ print HTML "</strong>\n";
undef( $EmittedItem );
}
@@ -1139,7 +1152,8 @@
# formatting: insert a paragraph if preceding item has >1 paragraph
if( $After_Lpar ){
- print HTML "<p></p>\n";
+ #print HTML "<p></p>\n";
+ print HTML $need_dd ? "</dd>\n" : "</li>\n" if $After_Lpar;
$After_Lpar = 0;
}
@@ -1172,7 +1186,7 @@
}
$need_dd = 1;
}
- print HTML "</$emitted>" if $emitted;
+ #print HTML "</$emitted>" if $emitted;
print HTML "\n";
return $need_dd;
}
@@ -1191,6 +1205,7 @@
# process_back - process a pod back tag and convert it to HTML format.
#
sub process_back {
+ my $need_dd = shift;
if( $Listlevel == 0 ){
warn "$0: $Podfile: unexpected =back directive in paragraph $Paragraph. ignoring.\n";
return;
@@ -1201,7 +1216,8 @@
# $Listend[$Listlevel] may have never been initialized.
$Listlevel--;
if( defined $Listend[$Listlevel] ){
- print HTML '<p></p>' if $After_Lpar;
+ #print HTML '<p></p>' if $After_Lpar;
+ print HTML $need_dd ? "</dd>\n" : "</li>\n" if $After_Lpar;
print HTML $Listend[$Listlevel];
print HTML "\n";
pop( @Listend ); Perl Info
|
From @schwernOn Tue, Jul 12, 2005 at 11:55:28PM -0700, Earl Hood wrote:
As a note for future patches, just delete old code. Commented out old code -- |
The RT System itself - Status changed from 'new' to 'open' |
From @steve-m-hayEarl Hood (via RT) wrote:
Removing those line breaks is definitely an improvement, but the patch Looks fine to me, but before I commit it is anyone particularly wedded Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email. |
From @steve-m-hay |
From @steve-m-hay |
From @rgsSteve Hay wrote:
I think it's ok, fixing generated HTML is more important than being |
From @steve-m-hayEarl Hood (via RT) wrote:
Thanks, applied to bleadperl as change 25181. I've deleted, rather than commented out, the old code, as Michael A further note to bear in mind for any future patches is that the patch Inline Patch--- Html.pm.5.8.6 Wed Jul 13 01:28:13 2005
+++ Html.pm Wed Jul 13 01:20:05 2005
Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email. |
From @steve-m-hayNow fixed in bleadperl. Should be in 5.8.8, otherwise in 5.10. |
@steve-m-hay - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#36526 (status was 'resolved')
Searchable as RT36526$
The text was updated successfully, but these errors were encountered: