|
|
@ -27,7 +27,7 @@ export default class Action {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
static drawLink (editor){
|
|
|
|
static drawLink (editor){
|
|
|
|
const cm = editor.codemirror;
|
|
|
|
const cm = editor.codemirror;
|
|
|
|
const stat = getState(cm);
|
|
|
|
const stat = Base.getState(cm);
|
|
|
|
const options = editor.options;
|
|
|
|
const options = editor.options;
|
|
|
|
let url = "http://";
|
|
|
|
let url = "http://";
|
|
|
|
if (options.promptURLs){
|
|
|
|
if (options.promptURLs){
|
|
|
@ -181,8 +181,10 @@ export default class Action {
|
|
|
|
|
|
|
|
|
|
|
|
if (is_code === "single"){
|
|
|
|
if (is_code === "single"){
|
|
|
|
// similar to some SimpleMDE _toggleBlock logic
|
|
|
|
// similar to some SimpleMDE _toggleBlock logic
|
|
|
|
let start = line.text.slice(0, cur_start.ch).replace("`", ""),
|
|
|
|
let start = line.text.slice(0, cur_start.ch)
|
|
|
|
end = line.text.slice(cur_start.ch).replace("`", "");
|
|
|
|
.replace("`", ""),
|
|
|
|
|
|
|
|
end = line.text.slice(cur_start.ch)
|
|
|
|
|
|
|
|
.replace("`", "");
|
|
|
|
cm.replaceRange(start + end, {
|
|
|
|
cm.replaceRange(start + end, {
|
|
|
|
line: cur_start.line,
|
|
|
|
line: cur_start.line,
|
|
|
|
ch: 0
|
|
|
|
ch: 0
|
|
|
@ -542,10 +544,12 @@ export default class Action {
|
|
|
|
const cm = editor.codemirror;
|
|
|
|
const cm = editor.codemirror;
|
|
|
|
Base.toggleHeading(cm, undefined, 1);
|
|
|
|
Base.toggleHeading(cm, undefined, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static toggleHeading2 (editor){
|
|
|
|
static toggleHeading2 (editor){
|
|
|
|
const cm = editor.codemirror;
|
|
|
|
const cm = editor.codemirror;
|
|
|
|
Base.toggleHeading(cm, undefined, 2);
|
|
|
|
Base.toggleHeading(cm, undefined, 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static toggleHeading3 (editor){
|
|
|
|
static toggleHeading3 (editor){
|
|
|
|
const cm = editor.codemirror;
|
|
|
|
const cm = editor.codemirror;
|
|
|
|
Base.toggleHeading(cm, undefined, 3);
|
|
|
|
Base.toggleHeading(cm, undefined, 3);
|
|
|
@ -598,10 +602,4 @@ export default class Action {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|