From: Joey Hess Date: Sun, 13 Jun 2010 03:00:30 +0000 (-0400) Subject: attachment: When inserting links, insert img directives for images, if that plugin... X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/commitdiff_plain/c65658eeb5cd83417f3ec1c69eff2ebcd6a481db?ds=sidebyside attachment: When inserting links, insert img directives for images, if that plugin is enabled. --- 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, diff --git a/debian/changelog b/debian/changelog index 07b349c57..fd7d1569e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,8 @@ ikiwiki (3.20100611) UNRELEASED; urgency=low page does not exist, so it can be easily created. * edittemplate: Look for template pages under templates/ like everything else (still looks in old location for backwards compatability). + * attachment: When inserting links, insert img directives for images, + if that plugin is enabled. -- Joey Hess Fri, 11 Jun 2010 13:39:15 -0400