git://git.jankratochvil.net
/
www.jankratochvil.net.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c745e32
)
Improved HTML vs. XHTML output validity.
author
lace
<>
Fri, 31 Mar 2006 02:12:00 +0000
(
02:12
+0000)
committer
lace
<>
Fri, 31 Mar 2006 02:12:00 +0000
(
02:12
+0000)
project/Pod2Html.pm
patch
|
blob
|
history
diff --git
a/project/Pod2Html.pm
b/project/Pod2Html.pm
index
2c785f4
..
a715162
100755
(executable)
--- a/
project/Pod2Html.pm
+++ b/
project/Pod2Html.pm
@@
-41,8
+41,11
@@
my $W=My::Web->init(
# From: <rt-3.0.11-37250-122352.19.7520280058314@perl.org>
# Do not: "content_type"=>"text/html",
# or whatever as pod2html(1) already produces XHTML.
# From: <rt-3.0.11-37250-122352.19.7520280058314@perl.org>
# Do not: "content_type"=>"text/html",
# or whatever as pod2html(1) already produces XHTML.
- "header_only"=>"xml",
+ # Do not: "header_only"=>"xml",
+ # as pod2html(1) already provides the <?xml ?> header.
"header_only"=>1,
"header_only"=>1,
+ # Match the pod2html(1) <meta/> tag.
+ "charset"=>"utf-8",
"http_safe"=>0, # lynx(1) downloads.
);
My::Web->heading();
"http_safe"=>0, # lynx(1) downloads.
);
My::Web->heading();
@@
-53,6
+56,9
@@
open F,"lynx -source ".$W->{"project_viewcvs"}."*checkout*/".$W->{"args"}{"cvs"}
# FIXME: "/tmp" - dangerous, not unique, currently creates: pod2htmd.tmp pod2htmi.tmp
." |pod2html --cachedir=/tmp -"
." |";
# FIXME: "/tmp" - dangerous, not unique, currently creates: pod2htmd.tmp pod2htmi.tmp
." |pod2html --cachedir=/tmp -"
." |";
+my $first=<F>;
+$first=undef() if $first && $W->{"content_type"} eq "text/html" && $first=~/^\Q<?xml\E\b.*\Q?>\E\s*$/s;
+print $first if $first;
print $_ while <F>;
close F;
print $_ while <F>;
close F;