mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-23 01:44:31 -06:00
Set indent style to 4 spaces
This commit is contained in:
parent
8a44ba70fb
commit
de26368ad1
6
.editorconfig
Normal file
6
.editorconfig
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[*]
|
||||||
|
charset=utf-8
|
||||||
|
end_of_line=lf
|
||||||
|
insert_final_newline=true
|
||||||
|
indent_style=space
|
||||||
|
indent_size=4
|
40
.eslintrc
40
.eslintrc
@ -1,23 +1,19 @@
|
|||||||
{
|
{
|
||||||
"rules": {
|
"rules": {
|
||||||
"indent": [
|
"strict": 0,
|
||||||
2,
|
"no-console": 0,
|
||||||
"tab"
|
"quotes": [
|
||||||
],
|
2,
|
||||||
"strict": 0,
|
"double"
|
||||||
"no-console": 0,
|
],
|
||||||
"quotes": [
|
"semi": [
|
||||||
2,
|
2,
|
||||||
"double"
|
"always"
|
||||||
],
|
]
|
||||||
"semi": [
|
},
|
||||||
2,
|
"env": {
|
||||||
"always"
|
"browser": true,
|
||||||
]
|
"node": true
|
||||||
},
|
},
|
||||||
"env": {
|
"extends": "eslint:recommended"
|
||||||
"browser": true,
|
}
|
||||||
"node":true
|
|
||||||
},
|
|
||||||
"extends": "eslint:recommended"
|
|
||||||
}
|
|
||||||
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,8 +1,7 @@
|
|||||||
localtesting/
|
# NPM files
|
||||||
node_modules/
|
node_modules/
|
||||||
bower_components/
|
|
||||||
|
|
||||||
#For IDE
|
# IDE files
|
||||||
*.iml
|
*.iml
|
||||||
*.ipr
|
*.ipr
|
||||||
*.iws
|
*.iws
|
||||||
|
@ -465,7 +465,7 @@ span.CodeMirror-selectedtext { background: none; }
|
|||||||
background: transparent;
|
background: transparent;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
text-decoration: none!important;
|
text-decoration: none !important;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@ -600,8 +600,8 @@ span.CodeMirror-selectedtext { background: none; }
|
|||||||
display: block
|
display: block
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview>p,
|
.editor-preview > p,
|
||||||
.editor-preview-side>p {
|
.editor-preview-side > p {
|
||||||
margin-top: 0
|
margin-top: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -675,6 +675,7 @@ span.CodeMirror-selectedtext { background: none; }
|
|||||||
.CodeMirror .CodeMirror-placeholder {
|
.CodeMirror .CodeMirror-placeholder {
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word) {
|
.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word) {
|
||||||
background: rgba(255, 0, 0, .15);
|
background: rgba(255, 0, 0, .15);
|
||||||
}
|
}
|
File diff suppressed because one or more lines are too long
3220
debug/simplemde.js
3220
debug/simplemde.js
File diff suppressed because it is too large
Load Diff
126
gulpfile.js
126
gulpfile.js
@ -1,83 +1,83 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var gulp = require("gulp"),
|
var gulp = require("gulp"),
|
||||||
minifycss = require("gulp-clean-css"),
|
minifycss = require("gulp-clean-css"),
|
||||||
uglify = require("gulp-uglify"),
|
uglify = require("gulp-uglify"),
|
||||||
concat = require("gulp-concat"),
|
concat = require("gulp-concat"),
|
||||||
header = require("gulp-header"),
|
header = require("gulp-header"),
|
||||||
buffer = require("vinyl-buffer"),
|
buffer = require("vinyl-buffer"),
|
||||||
pkg = require("./package.json"),
|
pkg = require("./package.json"),
|
||||||
debug = require("gulp-debug"),
|
debug = require("gulp-debug"),
|
||||||
eslint = require("gulp-eslint"),
|
eslint = require("gulp-eslint"),
|
||||||
browserify = require("browserify"),
|
browserify = require("browserify"),
|
||||||
source = require("vinyl-source-stream"),
|
source = require("vinyl-source-stream"),
|
||||||
rename = require("gulp-rename");
|
rename = require("gulp-rename");
|
||||||
|
|
||||||
var banner = ["/**",
|
var banner = ["/**",
|
||||||
" * <%= pkg.name %> v<%= pkg.version %>",
|
" * <%= pkg.name %> v<%= pkg.version %>",
|
||||||
" * Copyright <%= pkg.author %>",
|
" * Copyright <%= pkg.author %>",
|
||||||
" * @link <%= pkg.repository.url %>",
|
" * @link <%= pkg.repository.url %>",
|
||||||
" * @license <%= pkg.license %>",
|
" * @license <%= pkg.license %>",
|
||||||
" */",
|
" */",
|
||||||
""].join("\n");
|
""].join("\n");
|
||||||
|
|
||||||
gulp.task("lint", function() {
|
gulp.task("lint", function () {
|
||||||
gulp.src("./src/js/**/*.js")
|
gulp.src("./src/js/**/*.js")
|
||||||
.pipe(debug())
|
.pipe(debug())
|
||||||
.pipe(eslint())
|
.pipe(eslint())
|
||||||
.pipe(eslint.format())
|
.pipe(eslint.format())
|
||||||
.pipe(eslint.failAfterError());
|
.pipe(eslint.failAfterError());
|
||||||
});
|
});
|
||||||
|
|
||||||
function taskBrowserify(opts) {
|
function taskBrowserify(opts) {
|
||||||
return browserify("./src/js/simplemde.js", opts)
|
return browserify("./src/js/simplemde.js", opts)
|
||||||
.bundle();
|
.bundle();
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task("browserify:debug", ["lint"], function() {
|
gulp.task("browserify:debug", ["lint"], function () {
|
||||||
return taskBrowserify({debug:true, standalone:"SimpleMDE"})
|
return taskBrowserify({debug: true, standalone: "SimpleMDE"})
|
||||||
.pipe(source("simplemde.debug.js"))
|
.pipe(source("simplemde.debug.js"))
|
||||||
.pipe(buffer())
|
.pipe(buffer())
|
||||||
.pipe(header(banner, {pkg: pkg}))
|
.pipe(header(banner, {pkg: pkg}))
|
||||||
.pipe(gulp.dest("./debug/"));
|
.pipe(gulp.dest("./debug/"));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task("browserify", ["lint"], function() {
|
gulp.task("browserify", ["lint"], function () {
|
||||||
return taskBrowserify({standalone:"SimpleMDE"})
|
return taskBrowserify({standalone: "SimpleMDE"})
|
||||||
.pipe(source("simplemde.js"))
|
.pipe(source("simplemde.js"))
|
||||||
.pipe(buffer())
|
.pipe(buffer())
|
||||||
.pipe(header(banner, {pkg: pkg}))
|
.pipe(header(banner, {pkg: pkg}))
|
||||||
.pipe(gulp.dest("./debug/"));
|
.pipe(gulp.dest("./debug/"));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task("scripts", ["browserify:debug", "browserify", "lint"], function() {
|
gulp.task("scripts", ["browserify:debug", "browserify", "lint"], function () {
|
||||||
var js_files = ["./debug/simplemde.js"];
|
var js_files = ["./debug/simplemde.js"];
|
||||||
|
|
||||||
return gulp.src(js_files)
|
return gulp.src(js_files)
|
||||||
.pipe(concat("simplemde.min.js"))
|
.pipe(concat("simplemde.min.js"))
|
||||||
.pipe(uglify())
|
.pipe(uglify())
|
||||||
.pipe(buffer())
|
.pipe(buffer())
|
||||||
.pipe(header(banner, {pkg: pkg}))
|
.pipe(header(banner, {pkg: pkg}))
|
||||||
.pipe(gulp.dest("./dist/"));
|
.pipe(gulp.dest("./dist/"));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task("styles", function() {
|
gulp.task("styles", function () {
|
||||||
var css_files = [
|
var css_files = [
|
||||||
"./node_modules/codemirror/lib/codemirror.css",
|
"./node_modules/codemirror/lib/codemirror.css",
|
||||||
"./src/css/*.css",
|
"./src/css/*.css",
|
||||||
"./node_modules/codemirror-spell-checker/src/css/spell-checker.css"
|
"./node_modules/codemirror-spell-checker/src/css/spell-checker.css"
|
||||||
];
|
];
|
||||||
|
|
||||||
return gulp.src(css_files)
|
return gulp.src(css_files)
|
||||||
.pipe(concat("simplemde.css"))
|
.pipe(concat("simplemde.css"))
|
||||||
.pipe(buffer())
|
.pipe(buffer())
|
||||||
.pipe(header(banner, {pkg: pkg}))
|
.pipe(header(banner, {pkg: pkg}))
|
||||||
.pipe(gulp.dest("./debug/"))
|
.pipe(gulp.dest("./debug/"))
|
||||||
.pipe(minifycss())
|
.pipe(minifycss())
|
||||||
.pipe(rename("simplemde.min.css"))
|
.pipe(rename("simplemde.min.css"))
|
||||||
.pipe(buffer())
|
.pipe(buffer())
|
||||||
.pipe(header(banner, {pkg: pkg}))
|
.pipe(header(banner, {pkg: pkg}))
|
||||||
.pipe(gulp.dest("./dist/"));
|
.pipe(gulp.dest("./dist/"));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task("default", ["scripts", "styles"]);
|
gulp.task("default", ["scripts", "styles"]);
|
||||||
|
8028
package-lock.json
generated
8028
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
76
package.json
76
package.json
@ -1,40 +1,40 @@
|
|||||||
{
|
{
|
||||||
"name": "simplemde",
|
"name": "simplemde",
|
||||||
"version": "1.11.2",
|
"version": "1.11.2",
|
||||||
"description": "A simple, beautiful, and embeddable JavaScript Markdown editor. Features autosaving and spell checking.",
|
"description": "A simple, beautiful, and embeddable JavaScript Markdown editor. Features autosaving and spell checking.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"embeddable",
|
"embeddable",
|
||||||
"markdown",
|
"markdown",
|
||||||
"editor",
|
"editor",
|
||||||
"javascript",
|
"javascript",
|
||||||
"fontawesome"
|
"fontawesome"
|
||||||
],
|
],
|
||||||
"main": "./src/js/simplemde.js",
|
"main": "./src/js/simplemde.js",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "Jeroen Akkerman",
|
"author": "Jeroen Akkerman",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/ionaru/simplemde-markdown-editor/issues"
|
"url": "https://github.com/ionaru/simplemde-markdown-editor/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"codemirror": "^5.32.0",
|
"codemirror": "^5.32.0",
|
||||||
"codemirror-spell-checker": "^1.1.2",
|
"codemirror-spell-checker": "^1.1.2",
|
||||||
"marked": "^0.3.7"
|
"marked": "^0.3.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"browserify": "^14.5.0",
|
"browserify": "^14.5.0",
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^3.9.1",
|
||||||
"gulp-clean-css": "^3.9.0",
|
"gulp-clean-css": "^3.9.0",
|
||||||
"gulp-concat": "^2.6.1",
|
"gulp-concat": "^2.6.1",
|
||||||
"gulp-debug": "^3.1.0",
|
"gulp-debug": "^3.1.0",
|
||||||
"gulp-eslint": "^4.0.0",
|
"gulp-eslint": "^4.0.0",
|
||||||
"gulp-header": "^1.8.9",
|
"gulp-header": "^1.8.9",
|
||||||
"gulp-rename": "^1.2.2",
|
"gulp-rename": "^1.2.2",
|
||||||
"gulp-uglify": "^3.0.0",
|
"gulp-uglify": "^3.0.0",
|
||||||
"vinyl-buffer": "^1.0.0",
|
"vinyl-buffer": "^1.0.0",
|
||||||
"vinyl-source-stream": "^1.1.0"
|
"vinyl-source-stream": "^1.1.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/ionaru/simplemde-markdown-editor"
|
"url": "https://github.com/ionaru/simplemde-markdown-editor"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@
|
|||||||
background: transparent;
|
background: transparent;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
text-decoration: none!important;
|
text-decoration: none !important;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@ -247,8 +247,8 @@
|
|||||||
display: block
|
display: block
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-preview>p,
|
.editor-preview > p,
|
||||||
.editor-preview-side>p {
|
.editor-preview-side > p {
|
||||||
margin-top: 0
|
margin-top: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,4 +321,4 @@
|
|||||||
|
|
||||||
.CodeMirror .CodeMirror-placeholder {
|
.CodeMirror .CodeMirror-placeholder {
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
}
|
}
|
||||||
|
@ -4,41 +4,41 @@
|
|||||||
var CodeMirror = require("codemirror");
|
var CodeMirror = require("codemirror");
|
||||||
|
|
||||||
CodeMirror.commands.tabAndIndentMarkdownList = function (cm) {
|
CodeMirror.commands.tabAndIndentMarkdownList = function (cm) {
|
||||||
var ranges = cm.listSelections();
|
var ranges = cm.listSelections();
|
||||||
var pos = ranges[0].head;
|
var pos = ranges[0].head;
|
||||||
var eolState = cm.getStateAfter(pos.line);
|
var eolState = cm.getStateAfter(pos.line);
|
||||||
var inList = eolState.list !== false;
|
var inList = eolState.list !== false;
|
||||||
|
|
||||||
if (inList) {
|
if (inList) {
|
||||||
cm.execCommand("indentMore");
|
cm.execCommand("indentMore");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cm.options.indentWithTabs) {
|
if (cm.options.indentWithTabs) {
|
||||||
cm.execCommand("insertTab");
|
cm.execCommand("insertTab");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var spaces = Array(cm.options.tabSize + 1).join(" ");
|
var spaces = Array(cm.options.tabSize + 1).join(" ");
|
||||||
cm.replaceSelection(spaces);
|
cm.replaceSelection(spaces);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
CodeMirror.commands.shiftTabAndUnindentMarkdownList = function (cm) {
|
CodeMirror.commands.shiftTabAndUnindentMarkdownList = function (cm) {
|
||||||
var ranges = cm.listSelections();
|
var ranges = cm.listSelections();
|
||||||
var pos = ranges[0].head;
|
var pos = ranges[0].head;
|
||||||
var eolState = cm.getStateAfter(pos.line);
|
var eolState = cm.getStateAfter(pos.line);
|
||||||
var inList = eolState.list !== false;
|
var inList = eolState.list !== false;
|
||||||
|
|
||||||
if (inList) {
|
if (inList) {
|
||||||
cm.execCommand("indentLess");
|
cm.execCommand("indentLess");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cm.options.indentWithTabs) {
|
if (cm.options.indentWithTabs) {
|
||||||
cm.execCommand("insertTab");
|
cm.execCommand("insertTab");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var spaces = Array(cm.options.tabSize + 1).join(" ");
|
var spaces = Array(cm.options.tabSize + 1).join(" ");
|
||||||
cm.replaceSelection(spaces);
|
cm.replaceSelection(spaces);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
3160
src/js/simplemde.js
3160
src/js/simplemde.js
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user