mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-14 05:24:29 -06:00
Add toolbar button attributes to type declaration
This commit is contained in:
parent
98d9049728
commit
4ddb5b8e1b
@ -59,6 +59,9 @@ const editor2 = new EasyMDE({
|
|||||||
title: 'A Custom Button',
|
title: 'A Custom Button',
|
||||||
noDisable: undefined,
|
noDisable: undefined,
|
||||||
noMobile: false,
|
noMobile: false,
|
||||||
|
attributes: {
|
||||||
|
'data-custom': 'attribute',
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'|',
|
'|',
|
||||||
{
|
{
|
||||||
@ -89,6 +92,10 @@ const editor2 = new EasyMDE({
|
|||||||
action: EasyMDE.toggleBold,
|
action: EasyMDE.toggleBold,
|
||||||
className: 'fa fas fa-bold',
|
className: 'fa fas fa-bold',
|
||||||
title: 'Bold',
|
title: 'Bold',
|
||||||
|
attributes: {
|
||||||
|
'data-custom': 'some value',
|
||||||
|
'data-custom-2': 'another value',
|
||||||
|
}
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
5
types/easymde.d.ts
vendored
5
types/easymde.d.ts
vendored
@ -74,6 +74,10 @@ declare namespace EasyMDE {
|
|||||||
italic?: string;
|
italic?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface CustomAttributes {
|
||||||
|
[key: string]: string;
|
||||||
|
}
|
||||||
|
|
||||||
interface InsertTextOptions {
|
interface InsertTextOptions {
|
||||||
horizontalRule?: ReadonlyArray<string>;
|
horizontalRule?: ReadonlyArray<string>;
|
||||||
image?: ReadonlyArray<string>;
|
image?: ReadonlyArray<string>;
|
||||||
@ -142,6 +146,7 @@ declare namespace EasyMDE {
|
|||||||
noDisable?: boolean;
|
noDisable?: boolean;
|
||||||
noMobile?: boolean;
|
noMobile?: boolean;
|
||||||
icon?: string;
|
icon?: string;
|
||||||
|
attributes?: CustomAttributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ImageTextsOptions {
|
interface ImageTextsOptions {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user