mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-17 15:04:28 -06:00
Merge branch 'master' into fix_link
This commit is contained in:
commit
c0ea7aab25
@ -14,7 +14,7 @@ You can [submit an issue️](https://github.com/Ionaru/easy-markdown-editor/issu
|
||||
|
||||
### 📦 Prerequisites
|
||||
|
||||
You need node.js and npm.
|
||||
You need Node.js and npm.
|
||||
|
||||
To install them on Debian-based systems:
|
||||
|
||||
@ -37,7 +37,7 @@ git clone https://github.com/Ionaru/easy-markdown-editor.git
|
||||
cd easy-markdown-editor
|
||||
```
|
||||
|
||||
Then install the EasyMDE with npm:
|
||||
Then install the required dependencies:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
@ -50,12 +50,12 @@ Yay! You are ready! 🍾
|
||||
|
||||
1. First, [create a fork of this project](https://github.com/Ionaru/easy-markdown-editor/fork), and copy the https URL (*clone or download* button) of your project (something like https://github.com/YOUR_USERNAME/easy-markdown-editor.git );
|
||||
2. a) If you already cloned and worked on the project: `git remote add source https://github.com/Ionaru/easy-markdown-editor.git`;
|
||||
b) otherwise, clone your fork: `git clone https://github.com/YOUR_USERNAME/easy-markdown-editor.git`;
|
||||
3. create a new dedicated branch `git checkout -b myMergeRequest`;
|
||||
4. write some nice code and commit your work;
|
||||
5. check files against the ESLint syntax and build minified versions: `gulp`;
|
||||
6. push it to a dedicated branch `git push origin myMergeRequest`;
|
||||
7. got to the [main project page](https://github.com/Ionaru/easy-markdown-editor) and click on the button *Compare and pull request*, then fill the description.
|
||||
b) Otherwise, clone your fork: `git clone https://github.com/YOUR_USERNAME/easy-markdown-editor.git`;
|
||||
3. Create a new dedicated branch `git checkout -b myMergeRequest`;
|
||||
4. Write some nice code and commit your work;
|
||||
5. Check files against the ESLint syntax and build minified versions: `gulp`;
|
||||
6. Push it to a dedicated branch `git push origin myMergeRequest`;
|
||||
7. Go to the [main project page](https://github.com/Ionaru/easy-markdown-editor) and click on the button *Compare and pull request*, then fill the description.
|
||||
|
||||
If you want to make other pull requests, go back to the master branch (`git checkout master`), update it (`git pull --rebase source master`), then follow the instructions above from step 3.
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
[](https://www.npmjs.com/package/easymde)
|
||||
[](https://www.npmjs.com/package/easymde/v/next)
|
||||
[](https://travis-ci.org/Ionaru/easy-markdown-editor)
|
||||
[](https://travis-ci.org/Ionaru/easy-markdown-editor)
|
||||
|
||||
> This repository is a fork of
|
||||
[SimpleMDE, made by Sparksuite](https://github.com/sparksuite/simplemde-markdown-editor/).
|
||||
|
2
dist/easymde.min.js
vendored
2
dist/easymde.min.js
vendored
File diff suppressed because one or more lines are too long
872
package-lock.json
generated
872
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -22,7 +22,7 @@
|
||||
"marked": "^0.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/codemirror": "0.0.71",
|
||||
"@types/codemirror": "0.0.72",
|
||||
"browserify": "^16.2.3",
|
||||
"gulp": "^4.0.0",
|
||||
"gulp-clean-css": "^4.0.0",
|
||||
|
@ -1127,7 +1127,7 @@ function extend(target) {
|
||||
|
||||
/* The right word count in respect for CJK. */
|
||||
function wordCount(data) {
|
||||
var pattern = /[a-zA-Z0-9_\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g;
|
||||
var pattern = /[a-zA-Z0-9_\u00A0-\u02AF\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g;
|
||||
var m = data.match(pattern);
|
||||
var count = 0;
|
||||
if (m === null) return count;
|
||||
@ -1298,7 +1298,7 @@ var toolbarBuiltInButtons = {
|
||||
},
|
||||
'guide': {
|
||||
name: 'guide',
|
||||
action: 'https://simplemde.com/markdown-guide',
|
||||
action: 'https://www.markdownguide.org/basic-syntax/',
|
||||
className: 'fa fa-question-circle',
|
||||
noDisable: true,
|
||||
title: 'Markdown Guide',
|
||||
|
@ -1,14 +1,16 @@
|
||||
// Create new instance
|
||||
const editor = new EasyMDE({
|
||||
autoDownloadFontAwesome: false,
|
||||
element: document.getElementById("mdEditor")!,
|
||||
hideIcons: ["side-by-side", "fullscreen"],
|
||||
element: document.getElementById('mdEditor')!,
|
||||
hideIcons: ['side-by-side', 'fullscreen'],
|
||||
shortcuts: {
|
||||
drawTable: "Cmd-Alt-T",
|
||||
drawTable: 'Cmd-Alt-T',
|
||||
toggleFullScreen: null
|
||||
},
|
||||
spellChecker: false,
|
||||
onToggleFullScreen: (full: boolean) => { console.log('FullscreenToggled', full); },
|
||||
onToggleFullScreen: (full: boolean) => {
|
||||
console.log('FullscreenToggled', full);
|
||||
},
|
||||
theme: 'someOtherTheme',
|
||||
});
|
||||
|
||||
@ -23,4 +25,6 @@ const fullscreen = editor.isFullscreenActive() as boolean;
|
||||
editor.codemirror.setOption('readOnly', true);
|
||||
|
||||
// Static properties
|
||||
EasyMDE.toggleItalic = (editor: EasyMDE) => { console.log('SomeButtonOverride'); };
|
||||
EasyMDE.toggleItalic = (editor: EasyMDE) => {
|
||||
console.log('SomeButtonOverride');
|
||||
};
|
||||
|
14
types/easymde.d.ts
vendored
14
types/easymde.d.ts
vendored
@ -54,6 +54,7 @@ declare namespace EasyMDE {
|
||||
|
||||
interface Shortcuts {
|
||||
[action: string]: string | undefined | null;
|
||||
|
||||
toggleBlockquote?: string | null;
|
||||
toggleBold?: string | null;
|
||||
cleanBlock?: string | null;
|
||||
@ -78,7 +79,7 @@ declare namespace EasyMDE {
|
||||
|
||||
interface ToolbarIcon {
|
||||
name: string;
|
||||
action: string|((editor: EasyMDE) => void);
|
||||
action: string | ((editor: EasyMDE) => void);
|
||||
className: string;
|
||||
title: string;
|
||||
}
|
||||
@ -103,10 +104,10 @@ declare namespace EasyMDE {
|
||||
shortcuts?: Shortcuts;
|
||||
showIcons?: ReadonlyArray<string>;
|
||||
spellChecker?: boolean;
|
||||
status?: boolean|ReadonlyArray<string|StatusBarItem>;
|
||||
status?: boolean | ReadonlyArray<string | StatusBarItem>;
|
||||
styleSelectedText?: boolean;
|
||||
tabSize?: number;
|
||||
toolbar?: boolean|ReadonlyArray<string|ToolbarIcon>;
|
||||
toolbar?: boolean | ReadonlyArray<string | ToolbarIcon>;
|
||||
toolbarTips?: boolean;
|
||||
onToggleFullScreen?: (goingIntoFullScreen: boolean) => void;
|
||||
theme?: string;
|
||||
@ -115,13 +116,20 @@ declare namespace EasyMDE {
|
||||
|
||||
declare class EasyMDE {
|
||||
constructor(options?: EasyMDE.Options);
|
||||
|
||||
value(): string;
|
||||
value(val: string): void;
|
||||
|
||||
codemirror: CodeMirror.Editor;
|
||||
|
||||
toTextArea(): void;
|
||||
|
||||
isPreviewActive(): boolean;
|
||||
|
||||
isSideBySideActive(): boolean;
|
||||
|
||||
isFullscreenActive(): boolean;
|
||||
|
||||
clearAutosavedValue(): void;
|
||||
|
||||
static toggleBold: (editor: EasyMDE) => void;
|
||||
|
Loading…
x
Reference in New Issue
Block a user