mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2024-06-13 11:22:30 +02:00
Change replaceTexts to insertTexts
This commit is contained in:
parent
c1c8de5115
commit
73e5e5fb4e
File diff suppressed because one or more lines are too long
|
@ -13065,7 +13065,7 @@ function drawLink(editor) {
|
||||||
var cm = editor.codemirror;
|
var cm = editor.codemirror;
|
||||||
var stat = getState(cm);
|
var stat = getState(cm);
|
||||||
var options = editor.options;
|
var options = editor.options;
|
||||||
_replaceSelection(cm, stat.link, options.replaceTexts.link);
|
_replaceSelection(cm, stat.link, options.insertTexts.link);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13075,7 +13075,7 @@ function drawImage(editor) {
|
||||||
var cm = editor.codemirror;
|
var cm = editor.codemirror;
|
||||||
var stat = getState(cm);
|
var stat = getState(cm);
|
||||||
var options = editor.options;
|
var options = editor.options;
|
||||||
_replaceSelection(cm, stat.image, options.replaceTexts.image);
|
_replaceSelection(cm, stat.image, options.insertTexts.image);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13085,7 +13085,7 @@ function drawHorizontalRule(editor) {
|
||||||
var cm = editor.codemirror;
|
var cm = editor.codemirror;
|
||||||
var stat = getState(cm);
|
var stat = getState(cm);
|
||||||
var options = editor.options;
|
var options = editor.options;
|
||||||
_replaceSelection(cm, stat.image, options.replaceTexts.horizontalRule);
|
_replaceSelection(cm, stat.image, options.insertTexts.horizontalRule);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -13574,7 +13574,7 @@ var toolbarBuiltInButtons = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var replaceTexts = {
|
var insertTexts = {
|
||||||
link: ["[", "](http://)"],
|
link: ["[", "](http://)"],
|
||||||
image: ["![](http://", ")"],
|
image: ["![](http://", ")"],
|
||||||
horizontalRule: ["", "\n\n-----\n\n"]
|
horizontalRule: ["", "\n\n-----\n\n"]
|
||||||
|
@ -13652,8 +13652,8 @@ function SimpleMDE(options) {
|
||||||
options.parsingConfig = options.parsingConfig || {};
|
options.parsingConfig = options.parsingConfig || {};
|
||||||
|
|
||||||
|
|
||||||
// Merging the replaceTexts, with the given options
|
// Merging the insertTexts, with the given options
|
||||||
options.replaceTexts = extend({}, replaceTexts, options.replaceTexts || {});
|
options.insertTexts = extend({}, insertTexts, options.insertTexts || {});
|
||||||
|
|
||||||
|
|
||||||
// Update this options
|
// Update this options
|
||||||
|
|
|
@ -269,7 +269,7 @@ function drawLink(editor) {
|
||||||
var cm = editor.codemirror;
|
var cm = editor.codemirror;
|
||||||
var stat = getState(cm);
|
var stat = getState(cm);
|
||||||
var options = editor.options;
|
var options = editor.options;
|
||||||
_replaceSelection(cm, stat.link, options.replaceTexts.link);
|
_replaceSelection(cm, stat.link, options.insertTexts.link);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -279,7 +279,7 @@ function drawImage(editor) {
|
||||||
var cm = editor.codemirror;
|
var cm = editor.codemirror;
|
||||||
var stat = getState(cm);
|
var stat = getState(cm);
|
||||||
var options = editor.options;
|
var options = editor.options;
|
||||||
_replaceSelection(cm, stat.image, options.replaceTexts.image);
|
_replaceSelection(cm, stat.image, options.insertTexts.image);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -289,7 +289,7 @@ function drawHorizontalRule(editor) {
|
||||||
var cm = editor.codemirror;
|
var cm = editor.codemirror;
|
||||||
var stat = getState(cm);
|
var stat = getState(cm);
|
||||||
var options = editor.options;
|
var options = editor.options;
|
||||||
_replaceSelection(cm, stat.image, options.replaceTexts.horizontalRule);
|
_replaceSelection(cm, stat.image, options.insertTexts.horizontalRule);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -778,7 +778,7 @@ var toolbarBuiltInButtons = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var replaceTexts = {
|
var insertTexts = {
|
||||||
link: ["[", "](http://)"],
|
link: ["[", "](http://)"],
|
||||||
image: ["![](http://", ")"],
|
image: ["![](http://", ")"],
|
||||||
horizontalRule: ["", "\n\n-----\n\n"]
|
horizontalRule: ["", "\n\n-----\n\n"]
|
||||||
|
@ -856,8 +856,8 @@ function SimpleMDE(options) {
|
||||||
options.parsingConfig = options.parsingConfig || {};
|
options.parsingConfig = options.parsingConfig || {};
|
||||||
|
|
||||||
|
|
||||||
// Merging the replaceTexts, with the given options
|
// Merging the insertTexts, with the given options
|
||||||
options.replaceTexts = extend({}, replaceTexts, options.replaceTexts || {});
|
options.insertTexts = extend({}, insertTexts, options.insertTexts || {});
|
||||||
|
|
||||||
|
|
||||||
// Update this options
|
// Update this options
|
||||||
|
|
Loading…
Reference in a new issue