mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2024-06-28 18:30:14 +02: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": {
|
||||
"indent": [
|
||||
2,
|
||||
"tab"
|
||||
],
|
||||
"strict": 0,
|
||||
"no-console": 0,
|
||||
"quotes": [
|
||||
2,
|
||||
"double"
|
||||
],
|
||||
"semi": [
|
||||
2,
|
||||
"always"
|
||||
]
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node":true
|
||||
},
|
||||
"extends": "eslint:recommended"
|
||||
}
|
||||
"rules": {
|
||||
"strict": 0,
|
||||
"no-console": 0,
|
||||
"quotes": [
|
||||
2,
|
||||
"double"
|
||||
],
|
||||
"semi": [
|
||||
2,
|
||||
"always"
|
||||
]
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": "eslint:recommended"
|
||||
}
|
||||
|
|
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -1,8 +1,7 @@
|
|||
localtesting/
|
||||
# NPM files
|
||||
node_modules/
|
||||
bower_components/
|
||||
|
||||
#For IDE
|
||||
# IDE files
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
|
|
|
@ -465,7 +465,7 @@ span.CodeMirror-selectedtext { background: none; }
|
|||
background: transparent;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
text-decoration: none!important;
|
||||
text-decoration: none !important;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin: 0;
|
||||
|
@ -600,8 +600,8 @@ span.CodeMirror-selectedtext { background: none; }
|
|||
display: block
|
||||
}
|
||||
|
||||
.editor-preview>p,
|
||||
.editor-preview-side>p {
|
||||
.editor-preview > p,
|
||||
.editor-preview-side > p {
|
||||
margin-top: 0
|
||||
}
|
||||
|
||||
|
@ -675,6 +675,7 @@ span.CodeMirror-selectedtext { background: none; }
|
|||
.CodeMirror .CodeMirror-placeholder {
|
||||
opacity: .5;
|
||||
}
|
||||
|
||||
.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word) {
|
||||
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";
|
||||
|
||||
var gulp = require("gulp"),
|
||||
minifycss = require("gulp-clean-css"),
|
||||
uglify = require("gulp-uglify"),
|
||||
concat = require("gulp-concat"),
|
||||
header = require("gulp-header"),
|
||||
buffer = require("vinyl-buffer"),
|
||||
pkg = require("./package.json"),
|
||||
debug = require("gulp-debug"),
|
||||
eslint = require("gulp-eslint"),
|
||||
browserify = require("browserify"),
|
||||
source = require("vinyl-source-stream"),
|
||||
rename = require("gulp-rename");
|
||||
minifycss = require("gulp-clean-css"),
|
||||
uglify = require("gulp-uglify"),
|
||||
concat = require("gulp-concat"),
|
||||
header = require("gulp-header"),
|
||||
buffer = require("vinyl-buffer"),
|
||||
pkg = require("./package.json"),
|
||||
debug = require("gulp-debug"),
|
||||
eslint = require("gulp-eslint"),
|
||||
browserify = require("browserify"),
|
||||
source = require("vinyl-source-stream"),
|
||||
rename = require("gulp-rename");
|
||||
|
||||
var banner = ["/**",
|
||||
" * <%= pkg.name %> v<%= pkg.version %>",
|
||||
" * Copyright <%= pkg.author %>",
|
||||
" * @link <%= pkg.repository.url %>",
|
||||
" * @license <%= pkg.license %>",
|
||||
" */",
|
||||
""].join("\n");
|
||||
" * <%= pkg.name %> v<%= pkg.version %>",
|
||||
" * Copyright <%= pkg.author %>",
|
||||
" * @link <%= pkg.repository.url %>",
|
||||
" * @license <%= pkg.license %>",
|
||||
" */",
|
||||
""].join("\n");
|
||||
|
||||
gulp.task("lint", function() {
|
||||
gulp.src("./src/js/**/*.js")
|
||||
.pipe(debug())
|
||||
.pipe(eslint())
|
||||
.pipe(eslint.format())
|
||||
.pipe(eslint.failAfterError());
|
||||
gulp.task("lint", function () {
|
||||
gulp.src("./src/js/**/*.js")
|
||||
.pipe(debug())
|
||||
.pipe(eslint())
|
||||
.pipe(eslint.format())
|
||||
.pipe(eslint.failAfterError());
|
||||
});
|
||||
|
||||
function taskBrowserify(opts) {
|
||||
return browserify("./src/js/simplemde.js", opts)
|
||||
.bundle();
|
||||
return browserify("./src/js/simplemde.js", opts)
|
||||
.bundle();
|
||||
}
|
||||
|
||||
gulp.task("browserify:debug", ["lint"], function() {
|
||||
return taskBrowserify({debug:true, standalone:"SimpleMDE"})
|
||||
.pipe(source("simplemde.debug.js"))
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(gulp.dest("./debug/"));
|
||||
gulp.task("browserify:debug", ["lint"], function () {
|
||||
return taskBrowserify({debug: true, standalone: "SimpleMDE"})
|
||||
.pipe(source("simplemde.debug.js"))
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(gulp.dest("./debug/"));
|
||||
});
|
||||
|
||||
gulp.task("browserify", ["lint"], function() {
|
||||
return taskBrowserify({standalone:"SimpleMDE"})
|
||||
.pipe(source("simplemde.js"))
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(gulp.dest("./debug/"));
|
||||
gulp.task("browserify", ["lint"], function () {
|
||||
return taskBrowserify({standalone: "SimpleMDE"})
|
||||
.pipe(source("simplemde.js"))
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(gulp.dest("./debug/"));
|
||||
});
|
||||
|
||||
gulp.task("scripts", ["browserify:debug", "browserify", "lint"], function() {
|
||||
var js_files = ["./debug/simplemde.js"];
|
||||
|
||||
return gulp.src(js_files)
|
||||
.pipe(concat("simplemde.min.js"))
|
||||
.pipe(uglify())
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(gulp.dest("./dist/"));
|
||||
gulp.task("scripts", ["browserify:debug", "browserify", "lint"], function () {
|
||||
var js_files = ["./debug/simplemde.js"];
|
||||
|
||||
return gulp.src(js_files)
|
||||
.pipe(concat("simplemde.min.js"))
|
||||
.pipe(uglify())
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(gulp.dest("./dist/"));
|
||||
});
|
||||
|
||||
gulp.task("styles", function() {
|
||||
var css_files = [
|
||||
"./node_modules/codemirror/lib/codemirror.css",
|
||||
"./src/css/*.css",
|
||||
"./node_modules/codemirror-spell-checker/src/css/spell-checker.css"
|
||||
];
|
||||
|
||||
return gulp.src(css_files)
|
||||
.pipe(concat("simplemde.css"))
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(gulp.dest("./debug/"))
|
||||
.pipe(minifycss())
|
||||
.pipe(rename("simplemde.min.css"))
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(gulp.dest("./dist/"));
|
||||
gulp.task("styles", function () {
|
||||
var css_files = [
|
||||
"./node_modules/codemirror/lib/codemirror.css",
|
||||
"./src/css/*.css",
|
||||
"./node_modules/codemirror-spell-checker/src/css/spell-checker.css"
|
||||
];
|
||||
|
||||
return gulp.src(css_files)
|
||||
.pipe(concat("simplemde.css"))
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(gulp.dest("./debug/"))
|
||||
.pipe(minifycss())
|
||||
.pipe(rename("simplemde.min.css"))
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(gulp.dest("./dist/"));
|
||||
});
|
||||
|
||||
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",
|
||||
"version": "1.11.2",
|
||||
"description": "A simple, beautiful, and embeddable JavaScript Markdown editor. Features autosaving and spell checking.",
|
||||
"keywords": [
|
||||
"embeddable",
|
||||
"markdown",
|
||||
"editor",
|
||||
"javascript",
|
||||
"fontawesome"
|
||||
],
|
||||
"main": "./src/js/simplemde.js",
|
||||
"license": "MIT",
|
||||
"author": "Jeroen Akkerman",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ionaru/simplemde-markdown-editor/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"codemirror": "^5.32.0",
|
||||
"codemirror-spell-checker": "^1.1.2",
|
||||
"marked": "^0.3.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^14.5.0",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-clean-css": "^3.9.0",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-debug": "^3.1.0",
|
||||
"gulp-eslint": "^4.0.0",
|
||||
"gulp-header": "^1.8.9",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-uglify": "^3.0.0",
|
||||
"vinyl-buffer": "^1.0.0",
|
||||
"vinyl-source-stream": "^1.1.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ionaru/simplemde-markdown-editor"
|
||||
}
|
||||
"name": "simplemde",
|
||||
"version": "1.11.2",
|
||||
"description": "A simple, beautiful, and embeddable JavaScript Markdown editor. Features autosaving and spell checking.",
|
||||
"keywords": [
|
||||
"embeddable",
|
||||
"markdown",
|
||||
"editor",
|
||||
"javascript",
|
||||
"fontawesome"
|
||||
],
|
||||
"main": "./src/js/simplemde.js",
|
||||
"license": "MIT",
|
||||
"author": "Jeroen Akkerman",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ionaru/simplemde-markdown-editor/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"codemirror": "^5.32.0",
|
||||
"codemirror-spell-checker": "^1.1.2",
|
||||
"marked": "^0.3.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^14.5.0",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-clean-css": "^3.9.0",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-debug": "^3.1.0",
|
||||
"gulp-eslint": "^4.0.0",
|
||||
"gulp-header": "^1.8.9",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-uglify": "^3.0.0",
|
||||
"vinyl-buffer": "^1.0.0",
|
||||
"vinyl-source-stream": "^1.1.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ionaru/simplemde-markdown-editor"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
background: transparent;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
text-decoration: none!important;
|
||||
text-decoration: none !important;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin: 0;
|
||||
|
@ -247,8 +247,8 @@
|
|||
display: block
|
||||
}
|
||||
|
||||
.editor-preview>p,
|
||||
.editor-preview-side>p {
|
||||
.editor-preview > p,
|
||||
.editor-preview-side > p {
|
||||
margin-top: 0
|
||||
}
|
||||
|
||||
|
@ -321,4 +321,4 @@
|
|||
|
||||
.CodeMirror .CodeMirror-placeholder {
|
||||
opacity: .5;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,41 +4,41 @@
|
|||
var CodeMirror = require("codemirror");
|
||||
|
||||
CodeMirror.commands.tabAndIndentMarkdownList = function (cm) {
|
||||
var ranges = cm.listSelections();
|
||||
var pos = ranges[0].head;
|
||||
var eolState = cm.getStateAfter(pos.line);
|
||||
var inList = eolState.list !== false;
|
||||
var ranges = cm.listSelections();
|
||||
var pos = ranges[0].head;
|
||||
var eolState = cm.getStateAfter(pos.line);
|
||||
var inList = eolState.list !== false;
|
||||
|
||||
if (inList) {
|
||||
cm.execCommand("indentMore");
|
||||
return;
|
||||
}
|
||||
if (inList) {
|
||||
cm.execCommand("indentMore");
|
||||
return;
|
||||
}
|
||||
|
||||
if (cm.options.indentWithTabs) {
|
||||
cm.execCommand("insertTab");
|
||||
}
|
||||
else {
|
||||
var spaces = Array(cm.options.tabSize + 1).join(" ");
|
||||
cm.replaceSelection(spaces);
|
||||
}
|
||||
if (cm.options.indentWithTabs) {
|
||||
cm.execCommand("insertTab");
|
||||
}
|
||||
else {
|
||||
var spaces = Array(cm.options.tabSize + 1).join(" ");
|
||||
cm.replaceSelection(spaces);
|
||||
}
|
||||
};
|
||||
|
||||
CodeMirror.commands.shiftTabAndUnindentMarkdownList = function (cm) {
|
||||
var ranges = cm.listSelections();
|
||||
var pos = ranges[0].head;
|
||||
var eolState = cm.getStateAfter(pos.line);
|
||||
var inList = eolState.list !== false;
|
||||
var ranges = cm.listSelections();
|
||||
var pos = ranges[0].head;
|
||||
var eolState = cm.getStateAfter(pos.line);
|
||||
var inList = eolState.list !== false;
|
||||
|
||||
if (inList) {
|
||||
cm.execCommand("indentLess");
|
||||
return;
|
||||
}
|
||||
if (inList) {
|
||||
cm.execCommand("indentLess");
|
||||
return;
|
||||
}
|
||||
|
||||
if (cm.options.indentWithTabs) {
|
||||
cm.execCommand("insertTab");
|
||||
}
|
||||
else {
|
||||
var spaces = Array(cm.options.tabSize + 1).join(" ");
|
||||
cm.replaceSelection(spaces);
|
||||
}
|
||||
if (cm.options.indentWithTabs) {
|
||||
cm.execCommand("insertTab");
|
||||
}
|
||||
else {
|
||||
var spaces = Array(cm.options.tabSize + 1).join(" ");
|
||||
cm.replaceSelection(spaces);
|
||||
}
|
||||
};
|
||||
|
|
3160
src/js/simplemde.js
3160
src/js/simplemde.js
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue