Fix a few HTML 2.0 violations.

This commit is contained in:
John Fieber
1996-05-15 17:05:17 +00:00
parent d953e28acd
commit 95bb3b9747
2 changed files with 16 additions and 9 deletions
+6 -4
View File
@@ -66,8 +66,8 @@
<comment> + "<h4>Comment</h4>" +
</comment>
<abstract> + "<p><hr><em>"
</abstract> "</em><hr></p>" +
<abstract> + "<hr><p><em>"
</abstract> "</em></p><hr>" +
<appendix> + "<h2>Appendix</h2>" +
</appendix>
@@ -189,8 +189,10 @@
<biblio> + "<BIBLIO STYLE=\"[STYLE]\" FILES=\"[FILES]\">" +
</biblio>
<code> + "<hr>\n<pre>" +
</code> + "</pre>\n<hr>" +
<code> + "<pre>\n" +
</code> + "\n</pre>" +
% <code> + "<pre>\n<hr>" +
% </code> + "<hr>\n</pre>" +
<verb> + "<pre>" +
</verb> + "</pre>" +
+10 -5
View File
@@ -1,5 +1,5 @@
#!/usr/bin/perl
# $Id: sgmlfmt.pl,v 1.8 1995/10/07 22:28:34 jfieber Exp $
# $Id: sgmlfmt.pl,v 1.9 1996/03/26 13:26:53 jfieber Exp $
# Format an sgml document tagged according to the linuxdoc DTD.
# by John Fieber <jfieber@freebsd.org> for the FreeBSD documentation
@@ -44,6 +44,7 @@ else {
# Locate the DTD, an SGML declaration, and the replacement files
#
$doctype = "<!DOCTYPE html PUBLIC \"-//IETF//DTD HTML 2.0//EN\">";
$dtdbase = "$sgmldir/FreeBSD";
$dtd = "$dtdbase/dtd/linuxdoc";
if (-f "$dtd.dec") {
@@ -63,6 +64,7 @@ sub usage {
print "sgmlfmt -f <format> [-i <namea> ...] [-links] [-ssi] file\n";
print "where <format> is one of: html, latex, ascii, nroff\n";
}
#
# Look for the file specified on the command line
#
@@ -324,7 +326,7 @@ sub html2html {
push(@scs, $sc);
open(tocfile, ">${fileroot}_toc.html");
print tocfile "<HTML>\n";
print tocfile "$doctype\n<HTML>\n";
while (<$infile>) {
# change `<' and `>' to `&lt;' and `&gt;' in <pre></pre>
@@ -350,7 +352,7 @@ sub html2html {
print tocfile "<H1>$st_header[0]</H1>\n";
$header[$st_ol[$sc]] =
"<HTML>\n<HEAD>\n<TITLE>$st_header[0]</TITLE>\n" .
"$doctype\n<HTML>\n<HEAD>\n<TITLE>$st_header[0]</TITLE>\n" .
"</HEAD>\n<BODY>\n";
if ($opt_ssi) { # Server Side Include hook
$header[$st_ol[$sc]] .=
@@ -383,7 +385,7 @@ sub html2html {
# set up headers and footers
if ($st_sl[$sc] > 0 && $st_sl[$sc] <= $maxlevel) {
$header[$st_ol[$sc]] =
"<HTML>\n<HEAD>\n<TITLE>$_</TITLE>\n</HEAD>\n<BODY>\n";
"$doctype\n<HTML>\n<HEAD>\n<TITLE>$_</TITLE>\n</HEAD>\n<BODY>\n";
if ($opt_ssi) { # Server Side Include hook
$header[$st_ol[$sc]] .=
"<!--#include virtual=\"./$fileroot.hdr$st_ol[$sc]\" -->";
@@ -436,7 +438,7 @@ sub html2html {
$part = 0;
last tagsw;
}
print tocfile "</A></DD>\n";
print tocfile "</A>\n";
$i = $st_ol[$sc];
@@ -503,6 +505,9 @@ sub html2html {
# parent file(s).
if ($st_sl[$lsc] > $st_sl[$sc + 1]) {
print tocfile "</DL>\n";
if ($st_sl[$lsc] > 1) {
print tocfile "</DD>\n";
}
$i = $st_ol[$lsc] - 1 - ($st_sl[$lsc] == $st_ol[$lsc]);
for (; $i >= $st_pl[$lsc]; $i--) {
$text[$i] .= "</DL>\n";