diff options
author | Fred Drake <fdrake@acm.org> | 1999-09-23 15:29:45 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1999-09-23 15:29:45 (GMT) |
commit | d3d28d39f8209735c9fd6d250d9a61d20876a454 (patch) | |
tree | d71f554c13403252e069aa9214f41493d36a1746 /Doc/perl/l2hinit.perl | |
parent | d52879ccdca52ac93043f573eec4392c581bdf27 (diff) | |
download | cpython-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 "./".
Diffstat (limited to 'Doc/perl/l2hinit.perl')
-rw-r--r-- | Doc/perl/l2hinit.perl | 9 |
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; |