Skip to content

Commit f1d7df3

Browse files
committed
genhtml: Various invalid HTML fixes
Fix various invalid HTML elements generated by genhtml. Also fix file table width calculation. Signed-off-by: Peter Oberparleiter <[email protected]>
1 parent 867c2f5 commit f1d7df3

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

bin/genhtml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7511,23 +7511,17 @@ sub write_file_table_prolog(*$$$@)
75117511
{
75127512
my ($handle, $file_heading, $bin_heading, $primary_key, @columns) = @_;
75137513
my $num_columns = 0;
7514-
my $file_width;
7514+
my $file_width = 40;
75157515
my $col;
75167516
my $width;
75177517

7518-
$width = 20 if (scalar(@columns) == 1);
7519-
$width = 10 if (scalar(@columns) == 2);
7520-
$width = 8 if (scalar(@columns) > 2);
7521-
75227518
foreach $col (@columns) {
75237519
my ($heading, $cols, $titles) = @{$col};
7524-
if ($titles) {
7525-
$num_columns += scalar(@$titles);
7526-
} else {
7527-
$num_columns += $cols;
7528-
}
7520+
7521+
$num_columns += $cols;
75297522
}
7530-
$file_width = 100 - $num_columns * $width;
7523+
$num_columns++ if (defined($bin_heading));
7524+
$width = int((100 - $file_width) / $num_columns);
75317525

75327526
# Table definition
75337527
write_html($handle, <<END_OF_HTML);
@@ -7540,7 +7534,7 @@ END_OF_HTML
75407534
if (defined($bin_heading)) {
75417535
# owner or date column
75427536
write_html($handle, <<END_OF_HTML);
7543-
<td width=15</td>
7537+
<td width="$width%"></td>
75447538
END_OF_HTML
75457539
}
75467540
# Empty first row
@@ -8455,7 +8449,7 @@ sub write_source_line(*$$$$)
84558449
my $anchorClass = "";
84568450
if ($tla ne 'UNK') {
84578451
$class .= " tlaBg$bucket";
8458-
$anchorClass = "class=\"tlaBg$bucket\" ";
8452+
$anchorClass = " class=\"tlaBg$bucket\" ";
84598453
}
84608454
my $label =
84618455
$main::use_legacyLabels ?
@@ -9730,7 +9724,7 @@ sub get_sort_code($$$)
97309724
}
97319725
my $help = " title=\"Click to sort table by $alt\"";
97329726
$alt = "Sort by $alt";
9733-
return ' <span $help class="tableHeadSort">' .
9727+
return " <span $help class=\"tableHeadSort\">" .
97349728
$link_start . '<img src="' . $base . $png . '" width=10 height=14 ' .
97359729
'alt="' . $alt . '"' . $help . ' border=0>' . $link_end . '</span>';
97369730
}

0 commit comments

Comments
 (0)