diff --git a/src/js/simplemde.js b/src/js/simplemde.js index a5c1998..bdf6532 100644 --- a/src/js/simplemde.js +++ b/src/js/simplemde.js @@ -795,8 +795,9 @@ function _replaceSelection(cm, active, startEnd, url) { var text; var start = startEnd[0]; var end = startEnd[1]; - var startPoint = cm.getCursor("start"); - var endPoint = cm.getCursor("end"); + var startPoint = {}, endPoint = {}; + Object.assign(startPoint, cm.getCursor("start")); + Object.assign(endPoint, cm.getCursor("end")); if(url) { end = end.replace("#url#", url); } @@ -2033,4 +2034,4 @@ SimpleMDE.prototype.toTextArea = function() { } }; -module.exports = SimpleMDE; \ No newline at end of file +module.exports = SimpleMDE;