Added yaml and yaml-frontmatter modes

This commit is contained in:
ruisaraiva19 2016-06-05 00:53:29 +01:00
parent b6b1f7c1ef
commit ef61b04b11
7 changed files with 806 additions and 1725 deletions

View File

@ -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`.

View File

@ -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

16
dist/simplemde.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -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;
}