mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-06-27 05:01:02 -06:00
parent
fe680f09f6
commit
a602d3b826
@ -4,7 +4,10 @@ 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] -->
|
||||
## [Unreleased]
|
||||
### 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 +271,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,6 +443,7 @@ 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
|
||||
|
24
cypress/e2e/5-marked-options/index.html
Normal file
24
cypress/e2e/5-marked-options/index.html
Normal 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>
|
18
cypress/e2e/5-marked-options/marked-options.cy.js
Normal file
18
cypress/e2e/5-marked-options/marked-options.cy.js
Normal 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>');
|
||||
});
|
||||
});
|
@ -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
2
types/easymde.d.ts
vendored
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user