X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/9923f5db65f85485d10cb2b5a10c42bb36168de7..96c7e31c34b10e343afb3f17eb1ca7c34aaa4123:/IkiWiki/Plugin/attachment.pm diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index 53a65236c..9c774557f 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -195,7 +195,14 @@ sub formbuilder (@) { foreach my $f ($q->param("attachment_select")) { $f=Encode::decode_utf8($f); $f=~s/^$page\///; - $add.="[[$f]]\n"; + if (IkiWiki::isinlinableimage($f) && + UNIVERSAL::can("IkiWiki::Plugin::img", "import")) { + $add.='[[!img '.$f.' align="right" size="" alt=""]]'; + } + else { + $add.="[[$f]]"; + } + $add.="\n"; } $form->field(name => 'editcontent', value => $form->field('editcontent')."\n\n".$add,