【しばらく編集不可モードで運営します】 編集(管理者用) | 差分 | 新規作成 | 一覧 | RSS | FrontPage | 検索 | 更新履歴

plugin/img.pl - Alt付きインラインイメージとリンクををWiki中に挿入します。

目次

Alt付きインラインイメージとリンクををWiki中に挿入します。

プラグインについて

経緯

linkimg.pl version 1.1.0


use strict;

package linkimg;

sub plugin_inline {
  my($escaped_argument) = @_;
  my($alt, $imgurl, $url) = split(/;/, $escaped_argument);
  if ($imgurl =~ /^https?:.*\.(gif|png|jpeg|jpg)$/) {
	    if ($url =~ /^(mailto|http|https|ftp):/) {
	    return qq(<a href="$url"><img src="$imgurl" alt="$alt" /></a>);
	}
  } else {
    return qq(&linkimg($escaped_argument));
  }
}

sub plugin_usage {
  return {
    name        => 'linkimg',
    version     => '1.1.0',
    author      => 'XERE<xere2@yahoo.co.jp>',
    syntax      => '&linkimg(alt;imgurl;url)',
    description => 'embed an image with alt text and URL.',
    example     => '&linkimg(Screenshot;http://example.com/screenshot.png;http://example.com/)',
  };
}

1;

img.pl version 1.0.1

use strict;

package img;

sub plugin_inline {
    my ($escaped_argument) = @_;
    my ($caption, $url) = split(/;/, $escaped_argument);
    return qq(<img src="$url" alt="$caption">);
}

sub plugin_usage {
    return {
        name => 'img',
        version => '1.0.1',
        author => 'XERE <xere2[at]hotmail.com>',
        syntax => '&img(alt;url)',
        description => 'Insert Inline image with alt-tag',
        example => "Show this image &img(Image1;http://hoge.com/any.jpg).",
    };
}

1;

img.pl version 1.0

use strict;

package img;

sub plugin_inline {
    my ($escaped_argument) = @_;
    my ($caption, $url) = split(/,/, $escaped_argument);
    return qq(<img src="$url" alt="$caption">);
}

sub plugin_usage {
    return {
        name => 'img',
        version => '1.0',
        author => 'XERE <xere2[at]yahoo.co.jp>',
        syntax => '&img(alt,url)',
        description => 'Insert Inline image with alt-tag',
        example => "Show this image &img(Image1,http://hoge.com/any.jpg).",
    };
}

1;


(Too many spams ... embedded comments are not allowed now, sorry.)
    my ($caption, $url) = split(/;/, $escaped_argument);