Easymde insert image and insert image at cursor position #1405

This commit is contained in:
Diego Najar 2022-02-21 22:56:58 +01:00
parent 52ecf89b77
commit 5986c1d220

View file

@ -78,12 +78,12 @@ return <<<EOF
// Function required for Bludit // Function required for Bludit
// Insert HTML content at the cursor position // Insert HTML content at the cursor position
function editorInsertContent(html, type='') { function editorInsertContent(content, type='') {
var text = easymde.value(); var text = easymde.value();
if (type == 'image') { if (type == 'image') {
easymde.value(text + "![$langImage]("+filename+")" + "\\n"); easymde.codemirror.replaceSelection("![$langImage]("+content+")" + "\\n");
} else { } else {
easymde.value(html + "\\n"); easymde.codemirror.replaceSelection(content + "\\n");
} }
easymde.codemirror.refresh(); easymde.codemirror.refresh();
} }