aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-06-12 23:00:30 -0400
committerJoey Hess <joey@kitenet.net>2010-06-12 23:00:30 -0400
commitc65658eeb5cd83417f3ec1c69eff2ebcd6a481db (patch)
tree5b471d24923ef947246fab63bce549ad9b636617 /IkiWiki
parent35a0715b9a7a84b222523e648e815cbcc21301ed (diff)
downloadikiwiki-c65658eeb5cd83417f3ec1c69eff2ebcd6a481db.tar
ikiwiki-c65658eeb5cd83417f3ec1c69eff2ebcd6a481db.tar.gz
attachment: When inserting links, insert img directives for images, if that plugin is enabled.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/attachment.pm9
1 files changed, 8 insertions, 1 deletions
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,