Skip to content

Commit 490e57d

Browse files
author
Kasparas Galdikas
committed
Added mark-selection plugin from CodeMirror with config option on simplemde
1 parent 9eb0411 commit 490e57d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ simplemde.value("This text will appear in the editor");
106106
- **tabSize**: If set, customize the tab size. Defaults to `2`.
107107
- **toolbar**: If set to `false`, hide the toolbar. Defaults to the [array of icons](#toolbar-icons).
108108
- **toolbarTips**: If set to `false`, disable toolbar button tips. Defaults to `true`.
109+
- **styleSelectedText**: If set to `false`, remove `.CodeMirror-selectedtext` class from selected lines. Defaults to `true`.
109110

110111
```JavaScript
111112
// Most options demonstrate the non-default behavior

src/js/simplemde.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ require("codemirror/addon/display/fullscreen.js");
77
require("codemirror/mode/markdown/markdown.js");
88
require("codemirror/addon/mode/overlay.js");
99
require("codemirror/addon/display/placeholder.js");
10+
require("codemirror/addon/selection/mark-selection.js");
1011
require("codemirror/mode/gfm/gfm.js");
1112
require("codemirror/mode/xml/xml.js");
1213
require("spell-checker");
@@ -1483,7 +1484,8 @@ SimpleMDE.prototype.render = function(el) {
14831484
extraKeys: keyMaps,
14841485
lineWrapping: (options.lineWrapping === false) ? false : true,
14851486
allowDropFileTypes: ["text/plain"],
1486-
placeholder: options.placeholder || el.getAttribute("placeholder") || ""
1487+
placeholder: options.placeholder || el.getAttribute("placeholder") || "",
1488+
styleSelectedText: (options.styleSelectedText != undefined) ? options.styleSelectedText : true
14871489
});
14881490

14891491
if(options.forceSync === true) {

0 commit comments

Comments
 (0)