Compare commits

..

No commits in common. 'master' and '2.17.0' have entirely different histories.

@ -12,49 +12,39 @@ on:
- master
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
node-version: current
- uses: actions/checkout@v3
- run: npm audit --omit=dev
test:
needs: [ audit ]
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ '14', '16', '18' ]
node-version: [ '12', '14', '16', '18' ]
steps:
- uses: actions/setup-node@v3
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v2
- name: Audit
run: npm audit --production
- run: npm ci
- name: Install packages
run: npm install
- name: Test
run: npm test
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v2
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
retention-days: 7
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v2
if: always()
with:
name: cypress-videos
@ -68,13 +58,14 @@ jobs:
if: github.event_name == 'push'
steps:
- uses: actions/setup-node@v3
- uses: actions/setup-node@v2
with:
node-version: current
node-version: '16'
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- run: npm ci
- name: Install packages
run: npm install
- name: Deploy @latest version to npm
if: startsWith(github.ref, 'refs/tags/')

@ -4,10 +4,7 @@ All notable changes to EasyMDE will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
<!-- ## [Unreleased] -->
## [2.18.0] - 2022-09-20
### Added
- `toolbarButtonClassPrefix` option to resolve conflicts with Bootstrap classes ([#493]).
[//]: # (## [Unreleased])
## [2.17.0] - 2022-08-20
### Added
@ -257,7 +254,6 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown
- Cursor not always showing in "text" mode over the edit field
<!-- Linked issues -->
[#493]: https://github.com/Ionaru/easy-markdown-editor/issues/493
[#478]: https://github.com/Ionaru/easy-markdown-editor/issues/478
[#399]: https://github.com/Ionaru/easy-markdown-editor/issues/399
[#252]: https://github.com/Ionaru/easy-markdown-editor/issues/252
@ -419,8 +415,7 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown
[@sghoweri]: https://github.com/sghoweri
<!-- Linked versions -->
[Unreleased]: https://github.com/Ionaru/easy-markdown-editor/compare/2.18.0...HEAD
[2.18.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.17.0...2.18.0
[Unreleased]: https://github.com/Ionaru/easy-markdown-editor/compare/2.17.0...HEAD
[2.17.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.16.1...2.17.0
[2.16.1]: https://github.com/Ionaru/easy-markdown-editor/compare/2.16.0...2.16.1
[2.16.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.15.0...2.16.0

@ -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/next.svg?style=for-the-badge)](https://www.npmjs.com/package/easymde/v/next)
[![Build Status](https://img.shields.io/github/actions/workflow/status/ionaru/easy-markdown-editor/cd.yaml?branch=master&style=for-the-badge)](https://github.com/Ionaru/easy-markdown-editor/actions?query=branch%3Amaster)
[![Build Status](https://img.shields.io/github/workflow/status/ionaru/easy-markdown-editor/Test%20&%20Deploy/master?style=for-the-badge)](https://github.com/Ionaru/easy-markdown-editor/actions)
> This repository is a fork of
[SimpleMDE, made by Sparksuite](https://github.com/sparksuite/simplemde-markdown-editor/).
@ -16,9 +16,9 @@ In addition, the syntax is rendered while editing to clearly show the expected r
EasyMDE also features both built-in auto saving and spell checking.
The editor is entirely customizable, from theming to toolbar buttons and javascript hooks.
[**Try the demo**](https://stackblitz.com/edit/easymde/)
[**Try the demo**](https://easy-markdown-editor.tk/)
[![Preview](https://user-images.githubusercontent.com/3472373/51319377-26fe6e00-1a5d-11e9-8cc6-3137a566796d.png)](https://stackblitz.com/edit/easymde/)
[![Preview](https://user-images.githubusercontent.com/3472373/51319377-26fe6e00-1a5d-11e9-8cc6-3137a566796d.png)](https://easy-markdown-editor.tk/)
## Quick access
@ -206,7 +206,6 @@ easyMDE.value('New input for **EasyMDE**');
- **theme**: Override the theme. Defaults to `easymde`.
- **toolbar**: If set to `false`, hide the toolbar. Defaults to the [array of icons](#toolbar-icons).
- **toolbarTips**: If set to `false`, disable toolbar button tips. Defaults to `true`.
- **toolbarButtonClassPrefix**: Adds a prefix to the toolbar button classes when set. For example, a value of `"mde"` results in `"mde-bold"` for the Bold button.
- **direction**: `rtl` or `ltr`. Changes text direction to support right-to-left languages. Defaults to `ltr`.
@ -268,7 +267,7 @@ const editor = new EasyMDE({
preview.innerHTML = customMarkdownParser(plainText);
}, 250);
// If you return null, the innerHTML of the preview will not
// If you return null, the innerHTML of the preview will not
// be overwritten. Useful if you control the preview node's content via
// vdom diffing.
// return null;
@ -312,7 +311,6 @@ const editor = new EasyMDE({
tabSize: 4,
toolbar: false,
toolbarTips: false,
toolbarButtonClassPrefix: "mde",
});
```

@ -5,6 +5,5 @@ export default defineConfig({
excludeSpecPattern: [
'**/*.html',
],
video: true,
},
});

@ -11,8 +11,7 @@ describe('URL prompts', () => {
cy.window().then(($win) => {
const stub = cy.stub($win, 'prompt');
cy.get('button.link').click();
cy.get('button.link').then(() => {
cy.get('button.link').click().then(() => {
expect(stub).to.be.calledWith('URL for the link:', 'https://');
});
});
@ -24,8 +23,7 @@ describe('URL prompts', () => {
cy.window().then(($win) => {
const stub = cy.stub($win, 'prompt');
cy.get('button.image').click();
cy.get('button.image').then(() => {
cy.get('button.image').click().then(() => {
expect(stub).to.be.calledWith('URL of the image:', 'https://');
});
});
@ -54,8 +52,7 @@ describe('URL prompts', () => {
cy.window().then(($win) => {
const stub = cy.stub($win, 'prompt');
stub.returns('https://example.com');
cy.get('button.link').click();
cy.get('button.link').then(() => {
cy.get('button.link').click().then(() => {
expect(stub).to.be.calledWith('URL for the link:', 'https://');
stub.restore();
});
@ -66,8 +63,7 @@ describe('URL prompts', () => {
cy.window().then(($win) => {
const stub = cy.stub($win, 'prompt');
stub.returns('https://example.eu');
cy.get('button.link').click();
cy.get('button.link').then(() => {
cy.get('button.link').click().then(() => {
expect(stub).to.be.calledWith('URL for the link:', 'https://');
stub.restore();
});

@ -1,17 +0,0 @@
/// <reference types="cypress" />
describe('Default editor', () => {
it('table', () => {
cy.visit(__dirname + '/index-no-prefix.html');
cy.get('button.table').should('be.visible');
cy.get('button.table').invoke('outerWidth').should('not.equal', 30);
});
it('loads the editor with default settings', () => {
cy.visit(__dirname + '/index.html');
cy.get('button.mde-table').should('be.visible');
cy.get('button.mde-table').invoke('outerWidth').should('equal', 30);
});
});

@ -1,21 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Default</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="../../../dist/easymde.min.css">
<script src="../../../dist/easymde.min.js"></script>
</head>
<body>
<textarea id="textarea"></textarea>
<script>
const easyMDE = new EasyMDE({
showIcons: ["table"],
});
</script>
</body>
</html>

@ -1,22 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Default</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="../../../dist/easymde.min.css">
<script src="../../../dist/easymde.min.js"></script>
</head>
<body>
<textarea id="textarea"></textarea>
<script>
const easyMDE = new EasyMDE({
toolbarButtonClassPrefix: 'mde',
showIcons: ["table"],
});
</script>
</body>
</html>

1219
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
{
"name": "easymde",
"version": "2.18.0",
"version": "2.17.0",
"description": "A simple, beautiful, and embeddable JavaScript Markdown editor that easy to use. Features include autosaving and spell checking.",
"files": [
"dist/**/*",
@ -19,27 +19,27 @@
"license": "MIT",
"author": "Jeroen Akkerman",
"dependencies": {
"@types/codemirror": "^5.60.10",
"@types/marked": "^4.0.7",
"codemirror": "^5.65.15",
"@types/codemirror": "^5.60.4",
"@types/marked": "^4.0.1",
"codemirror": "^5.63.1",
"codemirror-spell-checker": "1.1.2",
"marked": "^4.1.0"
"marked": "^4.0.18"
},
"devDependencies": {
"browserify": "^17.0.0",
"cypress": "^13.2.0",
"eslint": "^8.50.0",
"eslint-plugin-cypress": "^2.15.1",
"cypress": "^10.3.1",
"eslint": "^8.20.0",
"eslint-plugin-cypress": "^2.12.1",
"gulp": "^4.0.2",
"gulp-clean-css": "^4.3.0",
"gulp-clean-css": "^4.2.0",
"gulp-concat": "^2.6.1",
"gulp-eslint": "^6.0.0",
"gulp-header": "^2.0.9",
"gulp-rename": "^2.0.0",
"gulp-terser": "^2.1.0",
"gulp-uglify": "^3.0.2",
"typescript": "^5.2.2",
"vinyl-buffer": "^1.0.1",
"typescript": "^4.7.4",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^2.0.0"
},
"repository": "github:Ionaru/easy-markdown-editor",

@ -194,8 +194,7 @@ function createToolbarButton(options, enableActions, enableTooltips, shortcuts,
}
}
var classNamePrefix = parent.options.toolbarButtonClassPrefix ? parent.options.toolbarButtonClassPrefix + '-' : '';
el.className = classNamePrefix + options.name;
el.className = options.name;
el.setAttribute('type', markup);
enableTooltips = (enableTooltips == undefined) ? true : enableTooltips;
@ -1870,7 +1869,6 @@ function EasyMDE(options) {
options.imagePathAbsolute = options.imagePathAbsolute || false;
options.imageCSRFName = options.imageCSRFName || 'csrfmiddlewaretoken';
options.imageCSRFHeader = options.imageCSRFHeader || false;
options.imageInputName = options.imageInputName || 'image';
// Change unique_id to uniqueId for backwards compatibility
@ -2690,7 +2688,7 @@ EasyMDE.prototype.createToolbar = function (items) {
imageInput.className = 'imageInput';
imageInput.type = 'file';
imageInput.multiple = true;
imageInput.name = self.options.imageInputName;
imageInput.name = 'image';
imageInput.accept = self.options.imageAccept;
imageInput.style.display = 'none';
imageInput.style.opacity = 0;

@ -103,7 +103,6 @@ const editor2 = new EasyMDE({
});
editor2.clearAutosavedValue();
editor2.updateStatusBar('upload-image', 'Drag & drop images!');
EasyMDE.togglePreview(editor2);
EasyMDE.toggleSideBySide(editor2);
@ -178,7 +177,6 @@ const editorImagesCustom = new EasyMDE({
});
new EasyMDE({
toolbarButtonClassPrefix: 'mde',
sideBySideFullscreen: true,
lineNumbers: false,
unorderedListStyle: '*',
@ -210,7 +208,6 @@ new EasyMDE({
'unordered-list',
'ordered-list',
'table',
'upload-image',
'|',
'link',
],
@ -218,21 +215,8 @@ new EasyMDE({
new EasyMDE({
direction: 'ltr',
});
})
new EasyMDE({
direction: 'rtl',
});
new EasyMDE({
previewRender: (plainText: string) => {
return '<pre>' + plainText + '</pre>';
}
});
new EasyMDE({
previewRender: (plainText: string, preview) => {
preview.innerHTML = '<pre>' + plainText + '</pre>';
return null;
}
});
})

@ -35,7 +35,6 @@ type ToolbarButton =
| 'ordered-list'
| 'link'
| 'image'
| 'upload-image'
| 'strikethrough'
| 'code'
| 'table'
@ -211,7 +210,6 @@ declare namespace EasyMDE {
tabSize?: number;
toolbar?: boolean | ReadonlyArray<'|' | ToolbarButton | ToolbarIcon | ToolbarDropdownIcon>;
toolbarTips?: boolean;
toolbarButtonClassPrefix?: string;
onToggleFullScreen?: (goingIntoFullScreen: boolean) => void;
theme?: string;
scrollbarStyle?: string;
@ -227,7 +225,6 @@ declare namespace EasyMDE {
imageCSRFName?: string;
imageCSRFHeader?: boolean;
imageTexts?: ImageTextsOptions;
imageInputName?: string
errorMessages?: ImageErrorTextsOptions;
errorCallback?: (errorMessage: string) => void;
@ -260,8 +257,6 @@ declare class EasyMDE {
clearAutosavedValue(): void;
updateStatusBar(itemName: string, content: string): void;
static toggleBold: (editor: EasyMDE) => void;
static toggleItalic: (editor: EasyMDE) => void;
static toggleStrikethrough: (editor: EasyMDE) => void;

@ -1,7 +1,6 @@
{
"compilerOptions": {
"target": "es3",
"ignoreDeprecations": "5.0",
"strict": true,
"noImplicitReturns": true,
"noEmit": true

Loading…
Cancel
Save