mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
img_tag(): Tighten up the generated SRC attribute a bit; if the image
relative URL starts with "./", remove "./".
This commit is contained in:
parent
d52879ccdc
commit
d3d28d39f8
1 changed files with 6 additions and 3 deletions
|
|
@ -251,9 +251,12 @@ sub img_tag {
|
||||||
,'border=', $nav_border, ' alt="', $alt
|
,'border=', $nav_border, ' alt="', $alt
|
||||||
,'" src="', $icon, '">' );
|
,'" src="', $icon, '">' );
|
||||||
}
|
}
|
||||||
return join('', '<img ', $iconsizes{$1}, $align
|
my $s = join('', '<img ', $iconsizes{$1}, $align,
|
||||||
,'border=', $nav_border, ' alt="', $alt, "\"\n"
|
'border=', $nav_border, ' alt="', $alt, "\"\n",
|
||||||
,' src="', $ICONSERVER, "/$icon", '">' );
|
' src="', $ICONSERVER, "/$icon", '">' );
|
||||||
|
# if $ICONSERVER starts with "./", remove "./":
|
||||||
|
$s =~ s|src="(.\/)+|src="|;
|
||||||
|
return $s;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return $icon;
|
return $icon;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue