2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-07-05 09:04:28 -06:00

Merge pull request #382 from jonatanklosko/issue-98

Fix bug with inserting links and undoing things.
This commit is contained in:
Wes Cossick 2016-07-12 11:43:24 -05:00 committed by GitHub
commit 580a4b0286

View File

@ -795,8 +795,9 @@ function _replaceSelection(cm, active, startEnd, url) {
var text; var text;
var start = startEnd[0]; var start = startEnd[0];
var end = startEnd[1]; var end = startEnd[1];
var startPoint = cm.getCursor("start"); var startPoint = {}, endPoint = {};
var endPoint = cm.getCursor("end"); Object.assign(startPoint, cm.getCursor("start"));
Object.assign(endPoint, cm.getCursor("end"));
if(url) { if(url) {
end = end.replace("#url#", url); end = end.replace("#url#", url);
} }
@ -2033,4 +2034,4 @@ SimpleMDE.prototype.toTextArea = function() {
} }
}; };
module.exports = SimpleMDE; module.exports = SimpleMDE;