mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2024-05-18 13:46:38 +02:00
Merge pull request #289 from foreachlt/style-selected-text
Added mark-selection plugin
This commit is contained in:
commit
2f4e7e4d9b
|
@ -106,6 +106,7 @@ simplemde.value("This text will appear in the editor");
|
||||||
- **tabSize**: If set, customize the tab size. Defaults to `2`.
|
- **tabSize**: If set, customize the tab size. Defaults to `2`.
|
||||||
- **toolbar**: If set to `false`, hide the toolbar. Defaults to the [array of icons](#toolbar-icons).
|
- **toolbar**: If set to `false`, hide the toolbar. Defaults to the [array of icons](#toolbar-icons).
|
||||||
- **toolbarTips**: If set to `false`, disable toolbar button tips. Defaults to `true`.
|
- **toolbarTips**: If set to `false`, disable toolbar button tips. Defaults to `true`.
|
||||||
|
- **styleSelectedText**: If set to `false`, remove `.CodeMirror-selectedtext` class from selected lines. Defaults to `true`.
|
||||||
|
|
||||||
```JavaScript
|
```JavaScript
|
||||||
// Most options demonstrate the non-default behavior
|
// Most options demonstrate the non-default behavior
|
||||||
|
|
|
@ -7,6 +7,7 @@ require("codemirror/addon/display/fullscreen.js");
|
||||||
require("codemirror/mode/markdown/markdown.js");
|
require("codemirror/mode/markdown/markdown.js");
|
||||||
require("codemirror/addon/mode/overlay.js");
|
require("codemirror/addon/mode/overlay.js");
|
||||||
require("codemirror/addon/display/placeholder.js");
|
require("codemirror/addon/display/placeholder.js");
|
||||||
|
require("codemirror/addon/selection/mark-selection.js");
|
||||||
require("codemirror/mode/gfm/gfm.js");
|
require("codemirror/mode/gfm/gfm.js");
|
||||||
require("codemirror/mode/xml/xml.js");
|
require("codemirror/mode/xml/xml.js");
|
||||||
require("spell-checker");
|
require("spell-checker");
|
||||||
|
@ -1483,7 +1484,8 @@ SimpleMDE.prototype.render = function(el) {
|
||||||
extraKeys: keyMaps,
|
extraKeys: keyMaps,
|
||||||
lineWrapping: (options.lineWrapping === false) ? false : true,
|
lineWrapping: (options.lineWrapping === false) ? false : true,
|
||||||
allowDropFileTypes: ["text/plain"],
|
allowDropFileTypes: ["text/plain"],
|
||||||
placeholder: options.placeholder || el.getAttribute("placeholder") || ""
|
placeholder: options.placeholder || el.getAttribute("placeholder") || "",
|
||||||
|
styleSelectedText: (options.styleSelectedText != undefined) ? options.styleSelectedText : true
|
||||||
});
|
});
|
||||||
|
|
||||||
if(options.forceSync === true) {
|
if(options.forceSync === true) {
|
||||||
|
|
Loading…
Reference in a new issue