From ce0ba8edbd24ed782706c15374bd1d41f2919713 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 2 Dec 2016 12:27:59 +0100 Subject: fix embed image for text/bbcode --- view/tpl/wiki.tpl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'view') diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index 226d785f5..cf4144357 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -366,8 +366,13 @@ $.post("embedphotos/photolink", {href: href}, function(ddata) { if (ddata['status']) { + {{if !$mimeType || $mimeType == 'text/markdown'}} var imgURL = ddata['photolink'].replace( /\[.*\]\[.*\](.*)\[.*\]\[.*\]/, '\n![image]($1)' ) editor.getSession().insert(editor.getCursorPosition(), imgURL) + {{else}} + var currentContent = $('#editor').val(); + $('#editor').val(currentContent + ddata['photolink']); + {{/if}} } else { window.console.log('{{$modalerrorlink}}' + ':' + ddata['errormsg']); } -- cgit v1.2.3