Added yaml and yaml-frontmatter modes

pull/347/head
ruisaraiva19 8 years ago
parent b6b1f7c1ef
commit ef61b04b11

@ -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`.
- **mode**: Can be set with `gfm` (Markdown), `yaml` or `yaml-frontmatter`. Defaults to `gfm`.
- **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`.

@ -58,7 +58,7 @@
}
.cm-fat-cursor .CodeMirror-cursor {
width: auto;
border: 0;
border: 0 !important;
background: #7e7;
}
.cm-fat-cursor div.CodeMirror-cursors {
@ -94,8 +94,14 @@
.cm-tab { display: inline-block; text-decoration: inherit; }
.CodeMirror-rulers {
position: absolute;
left: 0; right: 0; top: -50px; bottom: -20px;
overflow: hidden;
}
.CodeMirror-ruler {
border-left: 1px solid #ccc;
top: 0; bottom: 0;
position: absolute;
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -10,6 +10,8 @@ require("codemirror/addon/display/placeholder.js");
require("codemirror/addon/selection/mark-selection.js");
require("codemirror/mode/gfm/gfm.js");
require("codemirror/mode/xml/xml.js");
require("codemirror/mode/yaml/yaml.js");
require("codemirror/mode/yaml-frontmatter/yaml-frontmatter.js");
require("spell-checker");
var marked = require("marked");
@ -1464,11 +1466,11 @@ SimpleMDE.prototype.render = function(el) {
if(options.spellChecker !== false) {
mode = "spell-checker";
backdrop = options.parsingConfig;
backdrop.name = "gfm";
backdrop.name = options.mode || "gfm";
backdrop.gitHubSpice = false;
} else {
mode = options.parsingConfig;
mode.name = "gfm";
mode.name = options.mode || "gfm";
mode.gitHubSpice = false;
}

Loading…
Cancel
Save