summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1999-09-23 15:29:45 (GMT)
committerFred Drake <fdrake@acm.org>1999-09-23 15:29:45 (GMT)
commitd3d28d39f8209735c9fd6d250d9a61d20876a454 (patch)
treed71f554c13403252e069aa9214f41493d36a1746
parentd52879ccdca52ac93043f573eec4392c581bdf27 (diff)
downloadcpython-d3d28d39f8209735c9fd6d250d9a61d20876a454.zip
cpython-d3d28d39f8209735c9fd6d250d9a61d20876a454.tar.gz
cpython-d3d28d39f8209735c9fd6d250d9a61d20876a454.tar.bz2
img_tag(): Tighten up the generated SRC attribute a bit; if the image
relative URL starts with "./", remove "./".
-rw-r--r--Doc/perl/l2hinit.perl9
1 files changed, 6 insertions, 3 deletions
diff --git a/Doc/perl/l2hinit.perl b/Doc/perl/l2hinit.perl
index 92ad45a..9c92819 100644
--- a/Doc/perl/l2hinit.perl
+++ b/Doc/perl/l2hinit.perl
@@ -251,9 +251,12 @@ sub img_tag {
,'border=', $nav_border, ' alt="', $alt
,'" src="', $icon, '">' );
}
- return join('', '<img ', $iconsizes{$1}, $align
- ,'border=', $nav_border, ' alt="', $alt, "\"\n"
- ,' src="', $ICONSERVER, "/$icon", '">' );
+ my $s = join('', '<img ', $iconsizes{$1}, $align,
+ 'border=', $nav_border, ' alt="', $alt, "\"\n",
+ ' src="', $ICONSERVER, "/$icon", '">' );
+ # if $ICONSERVER starts with "./", remove "./":
+ $s =~ s|src="(.\/)+|src="|;
+ return $s;
}
else {
return $icon;