Documentation v3.16.0: https://raw.githack.com/uiwjs/react-md-editor/a482f99/index.html
Comparing Changes: v3.15.0...v3.16.0
npm i @uiw/react-md-editor@3.16.0
- 🌟 feat: add
command.render
options (#419). eab6b37 @jaywcjlove
const title2 = {
name: 'title3',
keyCommand: 'title3',
+ render: (command, disabled, executeCommand) => {
+ return (
+ <button
+ aria-label="Insert title3"
+ disabled={disabled}
+ onClick={(evn) => {
+ evn.stopPropagation();
+ executeCommand(command, command.groupName)
+ }}
+ >
+ btn
+ </button>
+ )
+ },
execute: (state, api) => {
let modifyText = `## ${state.selectedText}\n`;
if (!state.selectedText) {
modifyText = `## `;
}
api.replaceSelection(modifyText);
},
}