From: takezoe Date: Thu, 1 Dec 2011 15:22:15 +0000 (+0000) Subject: memoプラグインで名前を書けるようにした。 X-Git-Url: http://git.sourceforge.jp/view?p=fswiki%2Fsandbox.git;a=commitdiff_plain;h=89ed7e8c3ad8f7f89735c14cb7f6d7f0ca104b62;ds=sidebyside memoプラグインで名前を書けるようにした。 --- diff --git a/takezoe/plugin/book/Memo.pm b/takezoe/plugin/book/Memo.pm index 427b872..1af70ee 100644 --- a/takezoe/plugin/book/Memo.pm +++ b/takezoe/plugin/book/Memo.pm @@ -27,12 +27,26 @@ sub new { sub inline { my $self = shift; my $wiki = shift; + my $name = shift; my $text = shift; - push(@{$self->{'memolist'}}, "[comment]".$text); + if($text eq ''){ + $text = $name; + $name = ''; + } + + if($name ne ''){ + push(@{$self->{'memolist'}}, "[comment]".$name." - ".$text); + } else { + push(@{$self->{'memolist'}}, "[comment]".$text); + } my @list = @{$self->{'memolist'}}; - return ''.Util::escapeHTML($text).''; + if($name ne ''){ + return ''.Util::escapeHTML($name).' - '.Util::escapeHTML($text).''; + } else { + return ''.Util::escapeHTML($text).''; + } } 1;