mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-08-11 03:02:44 -06:00
Added typings for new option
This commit is contained in:
parent
71170a7eef
commit
7cfeb37257
@ -7,6 +7,7 @@ const editor = new EasyMDE({
|
|||||||
drawTable: 'Cmd-Alt-T',
|
drawTable: 'Cmd-Alt-T',
|
||||||
toggleFullScreen: null
|
toggleFullScreen: null
|
||||||
},
|
},
|
||||||
|
previewClass: 'my-custom-class',
|
||||||
spellChecker: false,
|
spellChecker: false,
|
||||||
onToggleFullScreen: (full: boolean) => {
|
onToggleFullScreen: (full: boolean) => {
|
||||||
console.log('FullscreenToggled', full);
|
console.log('FullscreenToggled', full);
|
||||||
@ -28,3 +29,33 @@ editor.codemirror.setOption('readOnly', true);
|
|||||||
EasyMDE.toggleItalic = (editor: EasyMDE) => {
|
EasyMDE.toggleItalic = (editor: EasyMDE) => {
|
||||||
console.log('SomeButtonOverride');
|
console.log('SomeButtonOverride');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const editor2 = new EasyMDE({
|
||||||
|
autoDownloadFontAwesome: undefined,
|
||||||
|
previewClass: ['my-custom-class', 'some-other-class'],
|
||||||
|
toolbar: [{
|
||||||
|
name: 'bold',
|
||||||
|
action: EasyMDE.toggleBold,
|
||||||
|
className: 'fa fa-bolt',
|
||||||
|
title: 'Bold',
|
||||||
|
}, '|', { // Separator
|
||||||
|
name: 'alert',
|
||||||
|
action: (editor) => {
|
||||||
|
alert('This is from a custom button action!');
|
||||||
|
// Custom functions have access to the `editor` instance.
|
||||||
|
},
|
||||||
|
className: 'fa fa-star',
|
||||||
|
title: 'A Custom Button',
|
||||||
|
noDisable: undefined,
|
||||||
|
noMobile: false,
|
||||||
|
}, '|', {
|
||||||
|
name: 'link',
|
||||||
|
action: 'https://github.com/Ionaru/easy-markdown-editor',
|
||||||
|
className: 'fa fab fa-github',
|
||||||
|
title: 'A Custom Link',
|
||||||
|
noDisable: true,
|
||||||
|
noMobile: true,
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
|
||||||
|
editor2.clearAutosavedValue();
|
||||||
|
1
types/easymde.d.ts
vendored
1
types/easymde.d.ts
vendored
@ -100,6 +100,7 @@ declare namespace EasyMDE {
|
|||||||
lineWrapping?: boolean;
|
lineWrapping?: boolean;
|
||||||
parsingConfig?: ParsingOptions;
|
parsingConfig?: ParsingOptions;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
|
previewClass?: string | ReadonlyArray<string>;
|
||||||
previewRender?: (markdownPlaintext: string, previewElement: HTMLElement) => string;
|
previewRender?: (markdownPlaintext: string, previewElement: HTMLElement) => string;
|
||||||
promptURLs?: boolean;
|
promptURLs?: boolean;
|
||||||
renderingConfig?: RenderingOptions;
|
renderingConfig?: RenderingOptions;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user