From 95ca4c3cdfbc9312e77b1bd20086fdd7977cd7d5 Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Mon, 6 Mar 2006 15:36:53 +0000 Subject: [PATCH] (ImageSupportRule): Handle spaces in external names. (ImageSupportRule): Don't generate an alt text if none was specified, since the rule forces you to pick an alt text if you're going to provide a target. --- modules/image.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/image.pl b/modules/image.pl index 66dbba50..bf9c286f 100644 --- a/modules/image.pl +++ b/modules/image.pl @@ -16,7 +16,7 @@ # 59 Temple Place, Suite 330 # Boston, MA 02111-1307 USA -$ModulesDescription .= '

$Id: image.pl,v 1.23 2006/03/06 14:19:56 as Exp $

'; +$ModulesDescription .= '

$Id: image.pl,v 1.24 2006/03/06 15:36:53 as Exp $

'; use vars qw($ImageUrlPath); @@ -28,12 +28,15 @@ push(@MyRules, \&ImageSupportRule); sub ImageSupportRule { my $result = undef; - if (m!\G\[\[image((/[a-z]+)*)( external)?:($FreeLinkPattern|$FullUrlPattern)(\|[^]|]+)?(\|($FreeLinkPattern|$FullUrlPattern))?(\|[^]|]+)?(\|($FreeLinkPattern|$FullUrlPattern))?\]\]!gc) { + if (m!\G\[\[image((/[a-z]+)*)( external)?:($FreeLinkPattern|$FullUrlPattern)(\|[^]|]+)?(\|($FreeLinkPattern|$FullUrlPattern|))?(\|[^]|]+)?(\|($FreeLinkPattern|$FullUrlPattern))?\]\]!gc) { my $oldpos = pos; my $class = 'image' . $1; my $external = $3; my $name = $4; - my $alt = $7 ? substr($7, 1) : $external ? "" : Ts("image: %s", $name); + # Don't generate an alt text if none was specified, since the rule + # forces you to pick an alt text if you're going to provide a + # link target. + my $alt = $7 ? substr($7, 1) : ''; my $link = $8 ? substr($8, 1) : ''; my $caption = $12 ? substr($12, 1) : ''; my $reference = $14;