2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-07-13 21:14:29 -06:00

Add toolbar button attributes to type declaration

This commit is contained in:
Jeroen Akkerman 2022-01-11 21:38:36 +01:00
parent 98d9049728
commit 4ddb5b8e1b
2 changed files with 12 additions and 0 deletions

View File

@ -59,6 +59,9 @@ const editor2 = new EasyMDE({
title: 'A Custom Button',
noDisable: undefined,
noMobile: false,
attributes: {
'data-custom': 'attribute',
}
},
'|',
{
@ -89,6 +92,10 @@ const editor2 = new EasyMDE({
action: EasyMDE.toggleBold,
className: 'fa fas fa-bold',
title: 'Bold',
attributes: {
'data-custom': 'some value',
'data-custom-2': 'another value',
}
},
],
},

5
types/easymde.d.ts vendored
View File

@ -74,6 +74,10 @@ declare namespace EasyMDE {
italic?: string;
}
interface CustomAttributes {
[key: string]: string;
}
interface InsertTextOptions {
horizontalRule?: ReadonlyArray<string>;
image?: ReadonlyArray<string>;
@ -142,6 +146,7 @@ declare namespace EasyMDE {
noDisable?: boolean;
noMobile?: boolean;
icon?: string;
attributes?: CustomAttributes;
}
interface ImageTextsOptions {