Fixed generation of invalid HTML code

git-svn-id: svn://svn.cc65.org/cc65/trunk@565 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2000-12-06 22:16:55 +00:00
parent ff31876edb
commit 100196a5d4

View File

@@ -486,23 +486,27 @@ sub Process2 {
$Line = $2; $Line = $2;
# Variable to assemble HTML representation # Variable to assemble HTML representation
my $Item = $Id; my $Contents = "";
# Make this import a link target
if (exists ($Imports{$OutName}{$Id})) {
$Label = $Imports{$OutName}{$1};
$Contents .= sprintf (" name=\"%s\"", $Label);
}
# If we have an export for this import, add a link to this # If we have an export for this import, add a link to this
# export definition # export definition
if (exists ($Exports{$Id})) { if (exists ($Exports{$Id})) {
$Label = $Exports{$Id}; $Label = $Exports{$Id};
$Item = sprintf ("<a href=\"%s\">%s</a>", $Label, $Item); $Contents .= sprintf (" href=\"%s\"", $Label);
}
# Make this import a link target
if (exists ($Imports{$OutName}{$Id})) {
$Label = $Imports{$OutName}{$1};
$Item = sprintf ("<a name=\"%s\">%s</a>", $Label, $Item);
} }
# Add the HTML stuff to the output line # Add the HTML stuff to the output line
$OutLine .= $Item; if ($Contents ne "") {
$OutLine .= sprintf ("<a%s>%s</a>", $Contents, $Id);
} else {
$OutLine .= $Id;
}
# Check if another identifier follows # Check if another identifier follows
if ($Line =~ /^(\s*),(\s*)(.*)$/) { if ($Line =~ /^(\s*),(\s*)(.*)$/) {
@@ -531,13 +535,13 @@ sub Process2 {
$Line = $2; $Line = $2;
# Variable to assemble HTML representation # Variable to assemble HTML representation
my $Item = $Id; my $Contents = "";
# If we have a definition for this export in this file, add # If we have a definition for this export in this file, add
# a link to the definition. # a link to the definition.
if (exists ($Labels{$OutName}{$1})) { if (exists ($Labels{$OutName}{$1})) {
$Label = $Labels{$OutName}{$1}; $Label = $Labels{$OutName}{$1};
$Item = sprintf ("<a href=\"#%s\">%s</a>", $Label, $Item); $Contents = sprintf (" href=\"#%s\"", $Label);
} }
# If we have this identifier in the list of exports, add a # If we have this identifier in the list of exports, add a
@@ -545,12 +549,16 @@ sub Process2 {
if (exists ($Exports{$Id})) { if (exists ($Exports{$Id})) {
$Label = $Exports{$Id}; $Label = $Exports{$Id};
# Be sure to use only the label part # Be sure to use only the label part
$Label =~ s/^(.*#)(.*)$/$2/; $Label =~ s/^(.*#)(.*)$/$2/; # ##FIXME: Expensive
$Item = sprintf ("<a name=\"%s\">%s</a>", $Label, $Item); $Contents .= sprintf (" name=\"%s\"", $Label);
} }
# Add the HTML stuff to the output line # Add the HTML stuff to the output line
$OutLine .= $Item; if ($Contents ne "") {
$OutLine .= sprintf ("<a%s>%s</a>", $Contents, $Id);
} else {
$OutLine .= $Id;
}
# Check if another identifier follows # Check if another identifier follows
if ($Line =~ /^(\s*),(\s*)(.*)$/) { if ($Line =~ /^(\s*),(\s*)(.*)$/) {