mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-18 15:34:28 -06:00
Add singleLineBreaks option
This commit is contained in:
parent
405b99ae92
commit
cbeb630a97
@ -66,6 +66,7 @@ simplemde.value();
|
|||||||
- **tabSize**: If set, customize the tab size. Defaults to `2`.
|
- **tabSize**: If set, customize the tab size. Defaults to `2`.
|
||||||
- **initialValue**: If set, will customize the initial value of the editor.
|
- **initialValue**: If set, will customize the initial value of the editor.
|
||||||
- **spellChecker**: If set to `false`, disable the spell checker. Defaults to `true`.
|
- **spellChecker**: If set to `false`, disable the spell checker. Defaults to `true`.
|
||||||
|
- **singleLineBreaks**: If set to `false`, disable parsing GFM single line breaks. Defaults to `true`.
|
||||||
- **autosave**: *Saves the text that's being written. It will forget the text when the form is submitted.*
|
- **autosave**: *Saves the text that's being written. It will forget the text when the form is submitted.*
|
||||||
- **enabled**: If set to `true`, autosave the text. Defaults to `false`.
|
- **enabled**: If set to `true`, autosave the text. Defaults to `false`.
|
||||||
- **unique_id**: You must set a unique identifier so that SimpleMDE can autosave. Something that separates this from other textareas.
|
- **unique_id**: You must set a unique identifier so that SimpleMDE can autosave. Something that separates this from other textareas.
|
||||||
@ -85,6 +86,7 @@ var simplemde = new SimpleMDE({
|
|||||||
tabSize: 4,
|
tabSize: 4,
|
||||||
initialValue: "Hello world!",
|
initialValue: "Hello world!",
|
||||||
spellChecker: false,
|
spellChecker: false,
|
||||||
|
singleLineBreaks: false,
|
||||||
autosave: {
|
autosave: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
unique_id: "MyUniqueID",
|
unique_id: "MyUniqueID",
|
||||||
|
@ -588,9 +588,11 @@ SimpleMDE.toolbar = toolbar;
|
|||||||
SimpleMDE.markdown = function(text) {
|
SimpleMDE.markdown = function(text) {
|
||||||
if(window.marked) {
|
if(window.marked) {
|
||||||
// Update options
|
// Update options
|
||||||
marked.setOptions({
|
if(this.options.singleLineBreaks !== false){
|
||||||
breaks: true
|
marked.setOptions({
|
||||||
});
|
breaks: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return marked(text);
|
return marked(text);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user