mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 06:35:15 +00:00
fix embed image for text/bbcode
This commit is contained in:
parent
ec97464007
commit
ce0ba8edbd
1 changed files with 5 additions and 0 deletions
|
@ -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']);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue