Open alindas opened 7 months ago
you can create a custom plugin for your job
import {Jodit} from "jodit";
Jodit.plugins.add('my-plugin', {
init(editor: Jodit) {
editor.events.on('afterCommand', function (command: any): false | void {
//Do nothing if not clicked bold
if (command != 'bold') return;
const current = editor.selection.current()?.parentNode;
//do your task here on current...
}
},
destruct(editor: Jodit) {
editor.events.off('beforeCommand');
}
})
you can create a custom plugin for your job
import {Jodit} from "jodit"; Jodit.plugins.add('my-plugin', { init(editor: Jodit) { editor.events.on('afterCommand', function (command: any): false | void { //Do nothing if not clicked bold if (command != 'bold') return; const current = editor.selection.current()?.parentNode; //do your task here on current... } }, destruct(editor: Jodit) { editor.events.off('beforeCommand'); } })
nice bro! i will try it soon
When using the bold option on the toolbar to bold the text, I noticed that it added a strong label to the selected dom text, and I want to add an inline style to the strong label. What can I do?
I have tried listening for "bold" and "common: bold" events, but none of them worked? Do you provide any callback functions? Where can I implement my ideas