[l2h] Doesn't recognise HTML version 4.01 though version script exists for it

Stuart Rossiter monsieurrigsby at googlemail.com
Wed Dec 9 17:40:06 CET 2009


Hi,

 Don't know if this is by design or oversight, but there exists a
versions directory script for HTML version 4.01 (html4_01.pl).

However, because of the checks in the initialisation code, this is
never used: setting -html_version=4.01 causes it to get truncated to
4.0 (see the sprintf statement in the source extract below):

  # Collect HTML options and figure out HTML version
    $HTML_OPTIONS = '' unless ($HTML_OPTIONS);
    $HTML_VERSION =~ s/^html|\s+//g;
    local(@HTML_VERSION) = split(/,/, $HTML_VERSION);
    foreach ( @HTML_VERSION ) {
	if (/^[\d\.]+$/) {
	    # Make sure $HTML_VERSION is in the right range and in the right format.
	    $HTML_VERSION = 0.0 + $_;
	    $HTML_VERSION = 2 if ( $HTML_VERSION < 2 );
	    $HTML_VERSION = 9 if ( $HTML_VERSION > 9 );
	    $HTML_VERSION = sprintf("%3.1f",$HTML_VERSION);
	} else {
	    $HTML_OPTIONS .= "$_,";
	}
    }
    $HTML_OPTIONS =~ s/\W$//;  # remove any trailing punctuation

    print "...producing markup for HTML version $HTML_VERSION  ";
    print ($HTML_OPTIONS ? "with $HTML_OPTIONS extensions\n\n\n" : "\n\n\n");

    # load the character defs for latin-1, but don't set the charset yet
    &do_require_extension('latin1');
    $charset = $CHARSET = $PREV_CHARSET = '';

    if ($HTML_VERSION =~ /(2.0|3.0|3.2|4.0|4.1)/) {
	# Require the version specific file
	do { $_ = "$LATEX2HTMLVERSIONS${dd}html$1.pl";
	     if (!(-f $_)) {  s/(\d).(\d.pl)$/$1_$2/ };
	     if (!(-f $_)) {  s/(\d)_(\d.pl)$/$1-$2/ };
	     require $_ || die "\n*** Could not load $_ ***\n";
	     print "\nHTML version: loading $_\n";
	} unless ($HTML_VERSION =~ /2.0/);
	$DOCTYPE = "-//".(($HTML_VERSION eq "2.0")? "IETF" : "W3C")
	    . "//DTD HTML $HTML_VERSION"
	    .(($HTML_VERSION eq "3.2")? " Final" : "")
	    .(($HTML_VERSION eq "4.0")? " Transitional" : "");

Allowing for it requires a few changes to the code above (the sprintf
stuff, the later if test, and 4.01 should also be Transitional in the
DOCTYPE as well).

Is this something that could be fixed, or is the 4.01 script redundant
(a quick diff shows that it is different to the 4.0 one)?

Thanks in advance,
Stuart

P.S. Using version 2002-2-1 (v1.71) from Ubuntu packages; this appears
to be the latest (final?) version. Is l2h still being actively
maintained?


More information about the latex2html mailing list