@x@imagename.extensionWhere "X" is one of l,r,i for image alignment and "extension" is one of "gif|jpg|png|jpeg".
It's in operation on the UnrealWiki.
Note: I've since altered this patch to create IMG CLASS="blah" instead of ALIGN="blah". Alignement options can then be set in CSS. "Display:block" is particularly useful I found.
Contact: Unreal:Tarquin
Set this in config too.
# tarq: @x@ markup for images s/(\@[lri]\@)(\S+\.(gif|jpg|png|jpeg))\s/&GetImgTag($1, $2)/gei ;
# ###### tarq: this makes an IMG tag sub GetImgTag{ my( $AlignLetter, $PicName ) = @_ ; my( $AlignFull , $ImgTag ); #$AlignFull = # {"l" => "left", "r" => "right", "i" => "inline"}->{lc $AlignLetter}; #print "Alignfull is: " . $AlignFull . "\n" ; if( $AlignLetter =~ /l/i ){ $AlignFull = "left"; } elsif( $AlignLetter =~ /r/i ){ $AlignFull = "right"; } elsif( $AlignLetter =~ /i/i ){ $AlignFull = "middle"; } # make sure to cover all possibilities matched in the calling search. $ImgTag = '<img align="' . $AlignFull . '" src="' . $ImgUrl . $PicName . '"> '; return $ImgTag ; } # ###### end tarq
# Restricted image URLs so that mailto:foo@bar.gif is not an imag if ($useImage && ($name =~ /^(http:|https:|ftp:).+\.$ImageExtensions$/)) { - return ("<img src=\"$name\">",$punct); + return ("$name", $punct); }
# ###### tarq: this makes an IMG tag sub GetImgTag { my($AlignLetter, $PicName) = @_ ; my($AlignFull , $ImgTag); if ($AlignLetter =~ /l/i) { $AlignFull = "left"; } elsif ($AlignLetter =~ /r/i) { $AlignFull = "right"; } elsif ($AlignLetter =~ /i/i) { $AlignFull = "middle"; } # make sure to cover all possibilities matched in the calling search. if ($PicName =~ /^(http:|https:|ftp:).+\.$ImageExtensions$/) { $ImgTag = '<img align="' . $AlignFull . '" src="' . $PicName . '"> '; return $ImgTag; } else { $ImgTag = '<img align="' . $AlignFull . '" src="' . $ImgUrl . $PicName . '"> '; return $ImgTag; } } # ###### end tarq