summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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>"