mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2025-09-24 16:40:55 -06:00
Merge cc192744b8e15474eea7eb7c4c80dfacb04d020a into 2fd52aa629a79ae678f9e3df7c1bb45a37594e8c
This commit is contained in:
commit
f4053a9eda
@ -83,6 +83,7 @@ simplemde.value("This text will appear in the editor");
|
||||
- **unique_id**: You must set a unique identifier so that SimpleMDE can autosave. Something that separates this from other textareas.
|
||||
- **delay**: Delay between saves, in milliseconds. Defaults to `10000` (10s).
|
||||
- **previewRender**: Custom function for parsing the plaintext Markdown and returning HTML. Used when user previews.
|
||||
- **codeMirrorModeConfig**: Additional CodeMirror config options to pass through to gfm and markdown modes.
|
||||
|
||||
```JavaScript
|
||||
var simplemde = new SimpleMDE({
|
||||
@ -113,6 +114,9 @@ var simplemde = new SimpleMDE({
|
||||
}, 250);
|
||||
|
||||
return "Loading...";
|
||||
},
|
||||
codeMirrorModeConfig: {
|
||||
highlightFormatting: true, taskLists: false
|
||||
}
|
||||
});
|
||||
```
|
||||
|
@ -761,6 +761,8 @@ function SimpleMDE(options) {
|
||||
}
|
||||
}
|
||||
|
||||
options.codeMirrorModeConfig = options.codeMirrorModeConfig || {};
|
||||
|
||||
// Update this options
|
||||
this.options = options;
|
||||
|
||||
@ -836,12 +838,14 @@ SimpleMDE.prototype.render = function(el) {
|
||||
if(cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
|
||||
};
|
||||
|
||||
var mode = "spell-checker";
|
||||
var backdrop = "gfm";
|
||||
|
||||
var mode, backdrop;
|
||||
if(options.spellChecker === false) {
|
||||
mode = "gfm";
|
||||
backdrop = undefined;
|
||||
mode = options.codeMirrorModeConfig;
|
||||
mode.name = 'gfm';
|
||||
} else {
|
||||
mode = 'spell-checker';
|
||||
backdrop = options.codeMirrorModeConfig;
|
||||
backdrop.name = 'gfm';
|
||||
}
|
||||
|
||||
this.codemirror = CodeMirror.fromTextArea(el, {
|
||||
|
Loading…
x
Reference in New Issue
Block a user