mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2025-09-24 16:40:55 -06:00
Merge 517d5ee2497b089a8920c34205029eac5888d6b1 into 6abda7ab68cc20f4aca870eb243747951b90ab04
This commit is contained in:
commit
527c85fc15
@ -88,6 +88,7 @@ simplemde.value("This text will appear in the editor");
|
||||
- link
|
||||
- table
|
||||
- **lineWrapping**: If set to `false`, disable line wrapping. Defaults to `true`.
|
||||
- **minHeight**: A minimal height of the editable area. Should be a string containing a valid CSS value like: `"400px"`. Dafaults to `"300px"`.
|
||||
- **parsingConfig**: Adjust settings for parsing the Markdown during editing (not previewing).
|
||||
- **allowAtxHeaderWithoutSpace**: If set to `true`, will render headers without a space after the `#`. Defaults to `false`.
|
||||
- **strikethrough**: If set to `false`, will not process GFM strikethrough syntax. Defaults to `true`.
|
||||
@ -96,8 +97,9 @@ simplemde.value("This text will appear in the editor");
|
||||
- **previewRender**: Custom function for parsing the plaintext Markdown and returning HTML. Used when user previews.
|
||||
- **promptURLs**: If set to `true`, a JS alert window appears asking for the link or image URL. Defaults to `false`.
|
||||
- **renderingConfig**: Adjust settings for parsing the Markdown during previewing (not editing).
|
||||
- **singleLineBreaks**: If set to `false`, disable parsing GFM single line breaks. Defaults to `true`.
|
||||
- **codeSyntaxHighlighting**: If set to `true`, will highlight using [highlight.js](https://github.com/isagalaev/highlight.js). Defaults to `false`. To use this feature you must include highlight.js on your page. For example, include the script and the CSS files like:<br>`<script src="https://cdn.jsdelivr.net/highlight.js/latest/highlight.min.js"></script>`<br>`<link rel="stylesheet" href="https://cdn.jsdelivr.net/highlight.js/latest/styles/github.min.css">`
|
||||
- **markedOptions**: Set the internal Markdown renderer's [options](https://github.com/chjj/marked#options-1). Other `renderingConfig` options will take precedence.
|
||||
- **singleLineBreaks**: If set to `false`, disable parsing GFM single line breaks. Defaults to `true`.
|
||||
- **shortcuts**: Keyboard shortcuts associated with this instance. Defaults to the [array of shortcuts](#keyboard-shortcuts).
|
||||
- **showIcons**: An array of icon names to show. Can be used to show specific icons hidden by default without completely customizing the toolbar.
|
||||
- **spellChecker**: If set to `false`, disable the spell checker. Defaults to `true`.
|
||||
|
@ -1,6 +1,5 @@
|
||||
.CodeMirror {
|
||||
height: auto;
|
||||
min-height: 300px;
|
||||
border: 1px solid #ddd;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
@ -9,10 +8,6 @@
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.CodeMirror-scroll {
|
||||
min-height: 300px
|
||||
}
|
||||
|
||||
.CodeMirror-fullscreen {
|
||||
background: #fff;
|
||||
position: fixed !important;
|
||||
|
@ -1364,6 +1364,8 @@ function SimpleMDE(options) {
|
||||
// Merging the shortcuts, with the given options
|
||||
options.shortcuts = extend({}, shortcuts, options.shortcuts || {});
|
||||
|
||||
options.minHeight = options.minHeight || "300px";
|
||||
|
||||
|
||||
// Change unique_id to uniqueId for backwards compatibility
|
||||
if(options.autosave != undefined && options.autosave.unique_id != undefined && options.autosave.unique_id != "")
|
||||
@ -1392,8 +1394,12 @@ function SimpleMDE(options) {
|
||||
SimpleMDE.prototype.markdown = function(text) {
|
||||
if(marked) {
|
||||
// Initialize
|
||||
var markedOptions = {};
|
||||
|
||||
var markedOptions;
|
||||
if(this.options && this.options.renderingConfig && this.options.renderingConfig.markedOptions) {
|
||||
markedOptions = this.options.renderingConfig.markedOptions;
|
||||
} else {
|
||||
markedOptions = {};
|
||||
}
|
||||
|
||||
// Update options
|
||||
if(this.options && this.options.renderingConfig && this.options.renderingConfig.singleLineBreaks === false) {
|
||||
@ -1495,6 +1501,8 @@ SimpleMDE.prototype.render = function(el) {
|
||||
styleSelectedText: (options.styleSelectedText != undefined) ? options.styleSelectedText : true
|
||||
});
|
||||
|
||||
this.codemirror.getScrollerElement().style.minHeight = options.minHeight;
|
||||
|
||||
if(options.forceSync === true) {
|
||||
var cm = this.codemirror;
|
||||
cm.on("change", function() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user