mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2024-05-18 21:56:40 +02:00
Merge pull request #264 from NextStepWebs/pr/256
Pull request #256 remove conflicts
This commit is contained in:
commit
711af1b472
|
@ -78,6 +78,7 @@ simplemde.value("This text will appear in the editor");
|
||||||
- **code** Can be set to ```` ``` ```` or `~~~`. Defaults to ```` ``` ````.
|
- **code** Can be set to ```` ``` ```` or `~~~`. Defaults to ```` ``` ````.
|
||||||
- **italic** Can be set to `*` or `_`. Defaults to `*`.
|
- **italic** Can be set to `*` or `_`. Defaults to `*`.
|
||||||
- **element**: The DOM element for the textarea to use. Defaults to the first textarea on the page.
|
- **element**: The DOM element for the textarea to use. Defaults to the first textarea on the page.
|
||||||
|
- **forceSync**: If set to `true`, force text changes made in SimpleMDE to be immediately stored in original textarea. Defaults to `false`.
|
||||||
- **hideIcons**: An array of icon names to hide. Can be used to hide specific icons shown by default without completely customizing the toolbar.
|
- **hideIcons**: An array of icon names to hide. Can be used to hide specific icons shown by default without completely customizing the toolbar.
|
||||||
- **indentWithTabs**: If set to `false`, indent using spaces instead of tabs. Defaults to `true`.
|
- **indentWithTabs**: If set to `false`, indent using spaces instead of tabs. Defaults to `true`.
|
||||||
- **initialValue**: If set, will customize the initial value of the editor.
|
- **initialValue**: If set, will customize the initial value of the editor.
|
||||||
|
@ -120,6 +121,7 @@ var simplemde = new SimpleMDE({
|
||||||
italic: "_"
|
italic: "_"
|
||||||
},
|
},
|
||||||
element: document.getElementById("MyID"),
|
element: document.getElementById("MyID"),
|
||||||
|
forceSync: true,
|
||||||
hideIcons: ["guide", "heading"],
|
hideIcons: ["guide", "heading"],
|
||||||
indentWithTabs: false,
|
indentWithTabs: false,
|
||||||
initialValue: "Hello world!",
|
initialValue: "Hello world!",
|
||||||
|
|
|
@ -1486,6 +1486,13 @@ SimpleMDE.prototype.render = function(el) {
|
||||||
placeholder: options.placeholder || el.getAttribute("placeholder") || ""
|
placeholder: options.placeholder || el.getAttribute("placeholder") || ""
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if(options.forceSync === true) {
|
||||||
|
var cm = this.codemirror;
|
||||||
|
cm.on("change", function() {
|
||||||
|
cm.save();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.gui = {};
|
this.gui = {};
|
||||||
|
|
||||||
if(options.toolbar !== false) {
|
if(options.toolbar !== false) {
|
||||||
|
|
Loading…
Reference in a new issue