summaryrefslogtreecommitdiffstats
path: root/Doc/perl/python.perl
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2003-11-26 20:55:49 (GMT)
committerFred Drake <fdrake@acm.org>2003-11-26 20:55:49 (GMT)
commit04bf7241e4d936dc1438880f3d96c9faf2eea208 (patch)
treeaf81163d1f20fc4def01f76e43eb278e86c1234b /Doc/perl/python.perl
parent2ce1d47e1ea7e6f157c8424cf535bc849541a194 (diff)
downloadcpython-04bf7241e4d936dc1438880f3d96c9faf2eea208.zip
cpython-04bf7241e4d936dc1438880f3d96c9faf2eea208.tar.gz
cpython-04bf7241e4d936dc1438880f3d96c9faf2eea208.tar.bz2
- clean up generated HTML
- make the output more XHTML friendly
Diffstat (limited to 'Doc/perl/python.perl')
-rw-r--r--Doc/perl/python.perl27
1 files changed, 20 insertions, 7 deletions
diff --git a/Doc/perl/python.perl b/Doc/perl/python.perl
index c1ebd19..3c3f7be 100644
--- a/Doc/perl/python.perl
+++ b/Doc/perl/python.perl
@@ -345,7 +345,7 @@ sub do_cmd_pep{
# Save the reference
my $nstr = gen_index_id("Python Enhancement Proposals!PEP $rfcnumber", '');
$index{$nstr} .= make_half_href("$CURRENT_FILE#$id");
- return ("<a class=\"rfc\" name=\"$id\" id='$id'\n"
+ return ("<a class=\"rfc\" id='$id'\n"
. "href=\"$href\">PEP $rfcnumber$icon</a>" . $_);
}
@@ -358,7 +358,7 @@ sub do_cmd_rfc{
# Save the reference
my $nstr = gen_index_id("RFC!RFC $rfcnumber", '');
$index{$nstr} .= make_half_href("$CURRENT_FILE#$id");
- return ("<a class=\"rfc\" name=\"$id\" id='$id'\nhref=\"$href\">"
+ return ("<a class=\"rfc\" id='$id'\nhref=\"$href\">"
. "RFC $rfcnumber$icon</a>" . $_);
}
@@ -510,10 +510,16 @@ sub add_index_entry($$){
write_idxfile($ahref, $str);
}
-sub new_link_info(){
+sub new_link_name_info(){
my $name = "l2h-" . ++$globals{'max_id'};
- my $aname = "<a name=\"$name\" id='$name'>";
+ my $aname = "<a id='$name'>";
my $ahref = gen_link($CURRENT_FILE, $name);
+ return ($name, $ahref);
+}
+
+sub new_link_info(){
+ my($name, $ahref) = new_link_name_info();
+ my $aname = "<a id='$name'>";
return ($name, $aname, $ahref);
}
@@ -738,9 +744,16 @@ init_myformat();
#
sub make_str_index_entry($){
my $str = $_[0];
- my($name, $aname, $ahref) = new_link_info();
+ my($name, $ahref) = new_link_name_info();
add_index_entry($str, $ahref);
- return "$aname$str</a>";
+ if ($str =~ /^<[a-z]+\b/) {
+ my $s = "$str";
+ $s =~ s/^<([a-z]+)\b/<$1 id='$name'/;
+ return $s;
+ }
+ else {
+ return "<a id='$name'>$str</a>";
+ }
}
@@ -817,7 +830,7 @@ sub do_cmd_production{
}
$TokenToTargetMapping{"$CURRENT_GRAMMAR:$token"} = $target;
return ("<tr valign=\"baseline\">\n"
- . " <td><code><a name=\"tok-$token\" id='tok-$token'>"
+ . " <td><code><a id='tok-$token'>"
. "$token</a></code></td>\n"
. " <td>&nbsp;::=&nbsp;</td>\n"
. " <td><code>"