2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-10-08 13:32:12 -06:00

Compare commits

..

4 Commits

Author SHA1 Message Date
Jeroen Akkerman
2996b67ec9
Update README.md 2025-05-01 18:41:05 +02:00
Jeroen akkerman
1708e40c42 2.20.0 2025-03-04 18:01:55 +01:00
Jeroen akkerman
f1e229f5b8 Update changelog for 2.20.0 2025-03-04 17:59:40 +01:00
Jeroen akkerman
a602d3b826 Add support for marked extensions
Fixes #514
Fixes #611
2025-02-21 22:31:16 +01:00
8 changed files with 58 additions and 7 deletions

View File

@ -5,6 +5,10 @@ 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.20.0] - 2025-03-04
### Added
- Support for `marked` extensions (Thanks to [@codingjoe], [#611], [#514]).
## [2.19.0] - 2025-02-18
### Added
- `updateStatusBar` type to typescript definitions (Thanks to [@borodean], [#519]).
@ -268,6 +272,8 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown
- Cursor not always showing in "text" mode over the edit field
<!-- Linked issues -->
[#611]: https://github.com/Ionaru/easy-markdown-editor/issues/611
[#514]: https://github.com/Ionaru/easy-markdown-editor/issues/514
[#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
@ -438,9 +444,11 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown
[@robinvandernoord]: https://github.com/robinvandernoord
[@p1gp1g]: https://github.com/p1gp1g
[@mayraamaral]: https://github.com/mayraamaral
[@codingjoe]: https://github.com/codingjoe
<!-- Linked versions -->
[Unreleased]: https://github.com/Ionaru/easy-markdown-editor/compare/2.19.0...HEAD
[Unreleased]: https://github.com/Ionaru/easy-markdown-editor/compare/2.20.0...HEAD
[2.20.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.19.0...2.20.0
[2.19.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.18.0...2.19.0
[2.18.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.17.0...2.18.0
[2.17.0]: https://github.com/Ionaru/easy-markdown-editor/compare/2.16.1...2.17.0

View File

@ -1,7 +1,8 @@
# EasyMDE - Markdown Editor
[![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 @next version](https://img.shields.io/npm/v/easymde/next.svg?style=for-the-badge)](https://www.npmjs.com/package/easymde/v/next)
[![npm @v3-alpha version](https://img.shields.io/npm/v/easymde/v3-alpha.svg?style=for-the-badge)](https://www.npmjs.com/package/easymde/v/v3-alpha)
[![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)
> This repository is a fork of

View File

@ -0,0 +1,24 @@
<!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="../../../dist/easymde.min.css">
<script src="../../../dist/easymde.min.js"></script>
</head>
<body>
<textarea id="textarea"></textarea>
<script>
const easyMDE = new EasyMDE({
renderingConfig: {
markedOptions: {
headerPrefix: 'header-prefix-',
}
}
});
</script>
</body>
</html>

View File

@ -0,0 +1,18 @@
/// <reference types="cypress" />
describe('Marked options', () => {
beforeEach(() => {
cy.visit(__dirname + '/index.html');
});
it('must apply the markedOptions to the markdown parser', () => {
cy.get('.EasyMDEContainer').should('be.visible');
cy.get('#textarea').should('not.be.visible');
cy.get('.EasyMDEContainer .CodeMirror').type('# Title{enter}');
cy.previewOn();
cy.get('.EasyMDEContainer .editor-preview').should('contain.html', '<h1 id="header-prefix-title">Title</h1>');
});
});

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "easymde",
"version": "2.19.0",
"version": "2.20.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "easymde",
"version": "2.19.0",
"version": "2.20.0",
"license": "MIT",
"dependencies": {
"@types/codemirror": "^5.60.10",

View File

@ -1,6 +1,6 @@
{
"name": "easymde",
"version": "2.19.0",
"version": "2.20.0",
"description": "A simple, beautiful, and embeddable JavaScript Markdown editor that easy to use. Features include autosaving and spell checking.",
"files": [
"dist/**/*",

View File

@ -2045,7 +2045,7 @@ EasyMDE.prototype.markdown = function (text) {
}
// Set options
marked.setOptions(markedOptions);
marked.use(markedOptions);
// Convert the markdown to HTML
var htmlText = marked.parse(text);

2
types/easymde.d.ts vendored
View File

@ -101,7 +101,7 @@ declare namespace EasyMDE {
interface RenderingOptions {
codeSyntaxHighlighting?: boolean;
hljs?: any;
markedOptions?: marked.MarkedOptions;
markedOptions?: marked.MarkedExtension;
sanitizerFunction?: (html: string) => string;
singleLineBreaks?: boolean;
}