Add missing configuration options

Fixes #126
pull/132/head
Jeroen Akkerman 5 years ago
parent d4a78e1a43
commit e9e5bef137

@ -4,7 +4,11 @@ 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/), 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). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
<!--## [Unreleased]--> ## [Unreleased]
### Added
- Missing minHeight option in type definition (Thanks to [@t49tran], [#123]).
- Other missing type definitions ([#126]).
## [2.8.0] - 2019-08-20 ## [2.8.0] - 2019-08-20
### Added ### Added
- Upload images functionality (Thanks to [@roipoussiere] and [@JeroenvO], [#71], [#101]). - Upload images functionality (Thanks to [@roipoussiere] and [@JeroenvO], [#71], [#101]).
@ -119,6 +123,7 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown
- Cursor not always showing in "text" mode over the edit field - Cursor not always showing in "text" mode over the edit field
<!-- Linked issues --> <!-- Linked issues -->
[#126]: https://github.com/Ionaru/easy-markdown-editor/issues/126
[#99]: https://github.com/Ionaru/easy-markdown-editor/issues/99 [#99]: https://github.com/Ionaru/easy-markdown-editor/issues/99
[#45]: https://github.com/Ionaru/easy-markdown-editor/issues/45 [#45]: https://github.com/Ionaru/easy-markdown-editor/issues/45
[#44]: https://github.com/Ionaru/easy-markdown-editor/issues/44 [#44]: https://github.com/Ionaru/easy-markdown-editor/issues/44
@ -131,6 +136,7 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown
[#9]: https://github.com/Ionaru/easy-markdown-editor/issues/9 [#9]: https://github.com/Ionaru/easy-markdown-editor/issues/9
<!-- Linked PRs --> <!-- Linked PRs -->
[#123]: https://github.com/Ionaru/easy-markdown-editor/pull/123
[#109]: https://github.com/Ionaru/easy-markdown-editor/pull/109 [#109]: https://github.com/Ionaru/easy-markdown-editor/pull/109
[#106]: https://github.com/Ionaru/easy-markdown-editor/pull/106 [#106]: https://github.com/Ionaru/easy-markdown-editor/pull/106
[#101]: https://github.com/Ionaru/easy-markdown-editor/pull/101 [#101]: https://github.com/Ionaru/easy-markdown-editor/pull/101
@ -144,6 +150,7 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown
[#19]: https://github.com/Ionaru/easy-markdown-editor/pull/19 [#19]: https://github.com/Ionaru/easy-markdown-editor/pull/19
<!-- Linked users --> <!-- Linked users -->
[@t49tran]: https://github.com/t49tran
[@richtera]: https://github.com/richtera [@richtera]: https://github.com/richtera
[@jfly]: https://github.com/jfly [@jfly]: https://github.com/jfly
[@sperezp]: https://github.com/sperezp [@sperezp]: https://github.com/sperezp

6
package-lock.json generated

@ -39,6 +39,12 @@
"integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",
"dev": true "dev": true
}, },
"@types/marked": {
"version": "0.6.5",
"resolved": "https://registry.npmjs.org/@types/marked/-/marked-0.6.5.tgz",
"integrity": "sha512-6kBKf64aVfx93UJrcyEZ+OBM5nGv4RLsI6sR1Ar34bpgvGVRoyTgpxn4ZmtxOM5aDTAaaznYuYUH8bUX3Nk3YA==",
"dev": true
},
"@types/tern": { "@types/tern": {
"version": "0.23.3", "version": "0.23.3",
"resolved": "https://registry.npmjs.org/@types/tern/-/tern-0.23.3.tgz", "resolved": "https://registry.npmjs.org/@types/tern/-/tern-0.23.3.tgz",

@ -25,6 +25,7 @@
}, },
"devDependencies": { "devDependencies": {
"@types/codemirror": "0.0.76", "@types/codemirror": "0.0.76",
"@types/marked": "^0.6.5",
"browserify": "^16.5.0", "browserify": "^16.5.0",
"gulp": "^4.0.2", "gulp": "^4.0.2",
"gulp-clean-css": "^4.2.0", "gulp-clean-css": "^4.2.0",

@ -121,5 +121,18 @@ const editorImagesCustom = new EasyMDE({
}, },
errorCallback: errorMessage => { errorCallback: errorMessage => {
console.error(errorMessage); console.error(errorMessage);
} },
}); renderingConfig: {
codeSyntaxHighlighting: true,
markedOptions: {
silent: true,
highlight(code: string, lang: string, callback?: (error: (any | undefined), code: string) => void): string {
return 'something'
},
},
},
promptTexts: {
image: 'Insert URL'
},
syncSideBySidePreviewScroll: true
});

13
types/easymde.d.ts vendored

@ -20,6 +20,7 @@
// SOFTWARE. // SOFTWARE.
/// <reference types="codemirror"/> /// <reference types="codemirror"/>
/// <reference types="marked"/>
declare namespace EasyMDE { declare namespace EasyMDE {
interface AutoSaveOptions { interface AutoSaveOptions {
@ -47,9 +48,16 @@ declare namespace EasyMDE {
underscoresBreakWords?: boolean; underscoresBreakWords?: boolean;
} }
interface PromptTexts {
image?: string;
link?: string;
}
interface RenderingOptions { interface RenderingOptions {
codeSyntaxHighlighting?: boolean;
hljs?: any;
markedOptions?: marked.MarkedOptions;
singleLineBreaks?: boolean; singleLineBreaks?: boolean;
codeSyntaxHighlighting: boolean;
} }
interface Shortcuts { interface Shortcuts {
@ -141,6 +149,9 @@ declare namespace EasyMDE {
imageTexts?: ImageTextsOptions; imageTexts?: ImageTextsOptions;
errorMessages?: ImageErrorTextsOptions; errorMessages?: ImageErrorTextsOptions;
errorCallback?: (errorMessage: string) => void; errorCallback?: (errorMessage: string) => void;
promptTexts?: PromptTexts;
syncSideBySidePreviewScroll?: boolean;
} }
} }

Loading…
Cancel
Save