2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-07-18 07:24:29 -06:00

Merge branch 'master' into fix_link

This commit is contained in:
Jeroen Akkerman 2019-02-27 23:49:07 +01:00 committed by GitHub
commit c0ea7aab25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 446 additions and 480 deletions

View File

@ -14,7 +14,7 @@ You can [submit an issue](https://github.com/Ionaru/easy-markdown-editor/issu
### 📦 Prerequisites ### 📦 Prerequisites
You need node.js and npm. You need Node.js and npm.
To install them on Debian-based systems: 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 cd easy-markdown-editor
``` ```
Then install the EasyMDE with npm: Then install the required dependencies:
```bash ```bash
npm install 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 ); 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`; 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`; 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`; 3. Create a new dedicated branch `git checkout -b myMergeRequest`;
4. write some nice code and commit your work; 4. Write some nice code and commit your work;
5. check files against the ESLint syntax and build minified versions: `gulp`; 5. Check files against the ESLint syntax and build minified versions: `gulp`;
6. push it to a dedicated branch `git push origin myMergeRequest`; 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. 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. 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.

View File

@ -2,7 +2,7 @@
[![npm version](https://img.shields.io/npm/v/easymde.svg?style=for-the-badge)](https://www.npmjs.com/package/easymde) [![npm version](https://img.shields.io/npm/v/easymde.svg?style=for-the-badge)](https://www.npmjs.com/package/easymde)
[![npm version](https://img.shields.io/npm/v/easymde/next.svg?style=for-the-badge)](https://www.npmjs.com/package/easymde/v/next) [![npm version](https://img.shields.io/npm/v/easymde/next.svg?style=for-the-badge)](https://www.npmjs.com/package/easymde/v/next)
[![Build Status](https://img.shields.io/travis/Ionaru/easy-markdown-editor.svg?style=for-the-badge)](https://travis-ci.org/Ionaru/easy-markdown-editor) [![Build Status](https://img.shields.io/travis/Ionaru/easy-markdown-editor/master.svg?style=for-the-badge)](https://travis-ci.org/Ionaru/easy-markdown-editor)
> This repository is a fork of > This repository is a fork of
[SimpleMDE, made by Sparksuite](https://github.com/sparksuite/simplemde-markdown-editor/). [SimpleMDE, made by Sparksuite](https://github.com/sparksuite/simplemde-markdown-editor/).

2
dist/easymde.min.js vendored

File diff suppressed because one or more lines are too long

872
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@
"marked": "^0.6.0" "marked": "^0.6.0"
}, },
"devDependencies": { "devDependencies": {
"@types/codemirror": "0.0.71", "@types/codemirror": "0.0.72",
"browserify": "^16.2.3", "browserify": "^16.2.3",
"gulp": "^4.0.0", "gulp": "^4.0.0",
"gulp-clean-css": "^4.0.0", "gulp-clean-css": "^4.0.0",

View File

@ -1127,7 +1127,7 @@ function extend(target) {
/* The right word count in respect for CJK. */ /* The right word count in respect for CJK. */
function wordCount(data) { 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 m = data.match(pattern);
var count = 0; var count = 0;
if (m === null) return count; if (m === null) return count;
@ -1298,7 +1298,7 @@ var toolbarBuiltInButtons = {
}, },
'guide': { 'guide': {
name: 'guide', name: 'guide',
action: 'https://simplemde.com/markdown-guide', action: 'https://www.markdownguide.org/basic-syntax/',
className: 'fa fa-question-circle', className: 'fa fa-question-circle',
noDisable: true, noDisable: true,
title: 'Markdown Guide', title: 'Markdown Guide',

View File

@ -1,14 +1,16 @@
// Create new instance // Create new instance
const editor = new EasyMDE({ const editor = new EasyMDE({
autoDownloadFontAwesome: false, autoDownloadFontAwesome: false,
element: document.getElementById("mdEditor")!, element: document.getElementById('mdEditor')!,
hideIcons: ["side-by-side", "fullscreen"], hideIcons: ['side-by-side', 'fullscreen'],
shortcuts: { shortcuts: {
drawTable: "Cmd-Alt-T", drawTable: 'Cmd-Alt-T',
toggleFullScreen: null toggleFullScreen: null
}, },
spellChecker: false, spellChecker: false,
onToggleFullScreen: (full: boolean) => { console.log('FullscreenToggled', full); }, onToggleFullScreen: (full: boolean) => {
console.log('FullscreenToggled', full);
},
theme: 'someOtherTheme', theme: 'someOtherTheme',
}); });
@ -23,4 +25,6 @@ const fullscreen = editor.isFullscreenActive() as boolean;
editor.codemirror.setOption('readOnly', true); editor.codemirror.setOption('readOnly', true);
// Static properties // Static properties
EasyMDE.toggleItalic = (editor: EasyMDE) => { console.log('SomeButtonOverride'); }; EasyMDE.toggleItalic = (editor: EasyMDE) => {
console.log('SomeButtonOverride');
};

14
types/easymde.d.ts vendored
View File

@ -54,6 +54,7 @@ declare namespace EasyMDE {
interface Shortcuts { interface Shortcuts {
[action: string]: string | undefined | null; [action: string]: string | undefined | null;
toggleBlockquote?: string | null; toggleBlockquote?: string | null;
toggleBold?: string | null; toggleBold?: string | null;
cleanBlock?: string | null; cleanBlock?: string | null;
@ -78,7 +79,7 @@ declare namespace EasyMDE {
interface ToolbarIcon { interface ToolbarIcon {
name: string; name: string;
action: string|((editor: EasyMDE) => void); action: string | ((editor: EasyMDE) => void);
className: string; className: string;
title: string; title: string;
} }
@ -103,10 +104,10 @@ declare namespace EasyMDE {
shortcuts?: Shortcuts; shortcuts?: Shortcuts;
showIcons?: ReadonlyArray<string>; showIcons?: ReadonlyArray<string>;
spellChecker?: boolean; spellChecker?: boolean;
status?: boolean|ReadonlyArray<string|StatusBarItem>; status?: boolean | ReadonlyArray<string | StatusBarItem>;
styleSelectedText?: boolean; styleSelectedText?: boolean;
tabSize?: number; tabSize?: number;
toolbar?: boolean|ReadonlyArray<string|ToolbarIcon>; toolbar?: boolean | ReadonlyArray<string | ToolbarIcon>;
toolbarTips?: boolean; toolbarTips?: boolean;
onToggleFullScreen?: (goingIntoFullScreen: boolean) => void; onToggleFullScreen?: (goingIntoFullScreen: boolean) => void;
theme?: string; theme?: string;
@ -115,13 +116,20 @@ declare namespace EasyMDE {
declare class EasyMDE { declare class EasyMDE {
constructor(options?: EasyMDE.Options); constructor(options?: EasyMDE.Options);
value(): string; value(): string;
value(val: string): void; value(val: string): void;
codemirror: CodeMirror.Editor; codemirror: CodeMirror.Editor;
toTextArea(): void; toTextArea(): void;
isPreviewActive(): boolean; isPreviewActive(): boolean;
isSideBySideActive(): boolean; isSideBySideActive(): boolean;
isFullscreenActive(): boolean; isFullscreenActive(): boolean;
clearAutosavedValue(): void; clearAutosavedValue(): void;
static toggleBold: (editor: EasyMDE) => void; static toggleBold: (editor: EasyMDE) => void;