mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2025-09-24 16:40:55 -06:00
fix bugs
This commit is contained in:
parent
ca6b87f016
commit
827300b1ed
28
.eslintrc
28
.eslintrc
@ -1,25 +1,25 @@
|
|||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"indent": [
|
// "indent": [
|
||||||
2,
|
// 2,
|
||||||
"tab"
|
// "tab"
|
||||||
],
|
// ],
|
||||||
"strict": 0,
|
"strict": 0,
|
||||||
"no-console": 0,
|
"no-console": 0
|
||||||
"quotes": [
|
// "quotes": [
|
||||||
2,
|
// 2,
|
||||||
"double"
|
// "double"
|
||||||
],
|
// ],
|
||||||
"semi": [
|
// "semi": [
|
||||||
2,
|
// 2,
|
||||||
"always"
|
// "never"
|
||||||
]
|
// ]
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
"browser": true,
|
"browser": true,
|
||||||
"node":true
|
"node":true
|
||||||
},
|
},
|
||||||
"extends": "eslint:recommended",
|
// "extends": "eslint:recommended",
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 6,
|
"ecmaVersion": 6,
|
||||||
"sourceType": "module"
|
"sourceType": "module"
|
||||||
|
File diff suppressed because one or more lines are too long
1883
debug/simplemde.js
1883
debug/simplemde.js
File diff suppressed because it is too large
Load Diff
18
dist/simplemde.min.js
vendored
18
dist/simplemde.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -4,7 +4,7 @@ import CodeMirrorSpellChecker from 'codemirror-spell-checker'
|
|||||||
import marked from 'marked'
|
import marked from 'marked'
|
||||||
import 'codemirror/addon/edit/continuelist'
|
import 'codemirror/addon/edit/continuelist'
|
||||||
import 'codemirror/addon/display/fullscreen'
|
import 'codemirror/addon/display/fullscreen'
|
||||||
import 'codemirror/addon/mode/overla'
|
import 'codemirror/addon/mode/overlay'
|
||||||
import 'codemirror/addon/display/placeholder'
|
import 'codemirror/addon/display/placeholder'
|
||||||
import 'codemirror/addon/selection/mark-selection'
|
import 'codemirror/addon/selection/mark-selection'
|
||||||
import './codemirror/tablist'
|
import './codemirror/tablist'
|
||||||
@ -53,10 +53,14 @@ const createSep = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const createTootlip = (title, action, shortcuts) => {
|
const createTootlip = (title, action, shortcuts) => {
|
||||||
|
let actionName;
|
||||||
let tooltip = title;
|
let tooltip = title;
|
||||||
|
|
||||||
if(action && shortcuts[utils.getBindingName(action)]) {
|
if(action) {
|
||||||
tooltip += " (" + utils.fixShortcut(shortcuts[actionName]) + ")"
|
actionName = utils.getBindingName(action);
|
||||||
|
if(shortcuts[actionName]) {
|
||||||
|
tooltip += " (" + utils.fixShortcut(shortcuts[actionName]) + ")";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return tooltip;
|
return tooltip;
|
||||||
@ -69,6 +73,7 @@ const createTootlip = (title, action, shortcuts) => {
|
|||||||
|
|
||||||
export class SimpleMDE extends Action {
|
export class SimpleMDE extends Action {
|
||||||
constructor(options = {}) {
|
constructor(options = {}) {
|
||||||
|
super()
|
||||||
// Used later to refer to it"s parent
|
// Used later to refer to it"s parent
|
||||||
options.parent = this;
|
options.parent = this;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user