From: cuz Date: Wed, 6 Dec 2000 22:16:55 +0000 (+0000) Subject: Fixed generation of invalid HTML code X-Git-Tag: V2.12.0~2977 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=100196a5d4a73e4cb4daca82eaba7f698052e4a0;p=cc65 Fixed generation of invalid HTML code git-svn-id: svn://svn.cc65.org/cc65/trunk@565 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ca65html/ca65html b/src/ca65html/ca65html index ec6895ffd..aabb072d4 100755 --- a/src/ca65html/ca65html +++ b/src/ca65html/ca65html @@ -486,24 +486,28 @@ sub Process2 { $Line = $2; # 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 # export definition if (exists ($Exports{$Id})) { $Label = $Exports{$Id}; - $Item = sprintf ("%s", $Label, $Item); + $Contents .= sprintf (" href=\"%s\"", $Label); } - # Make this import a link target - if (exists ($Imports{$OutName}{$Id})) { - $Label = $Imports{$OutName}{$1}; - $Item = sprintf ("%s", $Label, $Item); + # Add the HTML stuff to the output line + if ($Contents ne "") { + $OutLine .= sprintf ("%s", $Contents, $Id); + } else { + $OutLine .= $Id; } - # Add the HTML stuff to the output line - $OutLine .= $Item; - # Check if another identifier follows if ($Line =~ /^(\s*),(\s*)(.*)$/) { $OutLine .= "$1,$2"; @@ -531,13 +535,13 @@ sub Process2 { $Line = $2; # Variable to assemble HTML representation - my $Item = $Id; + my $Contents = ""; # If we have a definition for this export in this file, add # a link to the definition. if (exists ($Labels{$OutName}{$1})) { $Label = $Labels{$OutName}{$1}; - $Item = sprintf ("%s", $Label, $Item); + $Contents = sprintf (" href=\"#%s\"", $Label); } # If we have this identifier in the list of exports, add a @@ -545,12 +549,16 @@ sub Process2 { if (exists ($Exports{$Id})) { $Label = $Exports{$Id}; # Be sure to use only the label part - $Label =~ s/^(.*#)(.*)$/$2/; - $Item = sprintf ("%s", $Label, $Item); + $Label =~ s/^(.*#)(.*)$/$2/; # ##FIXME: Expensive + $Contents .= sprintf (" name=\"%s\"", $Label); } # Add the HTML stuff to the output line - $OutLine .= $Item; + if ($Contents ne "") { + $OutLine .= sprintf ("%s", $Contents, $Id); + } else { + $OutLine .= $Id; + } # Check if another identifier follows if ($Line =~ /^(\s*),(\s*)(.*)$/) {