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
// Insert HTML content at the cursor position
function editorInsertContent(html, type='') {
function editorInsertContent(content, type='') {
var text = easymde.value();
if (type == 'image') {
easymde.value(text + "![$langImage]("+filename+")" + "\\n");
easymde.codemirror.replaceSelection("![$langImage]("+content+")" + "\\n");
} else {
easymde.value(html + "\\n");
easymde.codemirror.replaceSelection(content + "\\n");
}
easymde.codemirror.refresh();
}